Remove spo redundant code

This commit is contained in:
xiangjinyu 2025-02-12 18:17:27 +08:00
parent 2528f2bf5f
commit 424726eed9
6 changed files with 13 additions and 25 deletions

View file

View file

@ -73,10 +73,3 @@ class QuickEvaluate:
except Exception as e:
logger.error(e)
return False
if __name__ == "__main__":
executor = QuickExecute(prompt="Answer the Question")
answers = asyncio.run(executor.prompt_execute())
print(answers)

View file

@ -22,7 +22,6 @@ class PromptOptimizer:
max_rounds: int = 10,
name: str = "",
template: str = "",
iteration: bool = True,
) -> None:
self.dataset = name
self.root_path = f"{optimized_path}/{self.dataset}"

View file

@ -18,13 +18,13 @@ class EvaluationUtils:
def __init__(self, root_path: str):
self.root_path = root_path
async def execute_prompt(self, optimizer, prompt_path, initial=False):
async def execute_prompt(self, optimizer, prompt_path):
optimizer.prompt = optimizer.prompt_utils.load_prompt(optimizer.round, prompt_path)
executor = QuickExecute(prompt=optimizer.prompt)
answers = await executor.prompt_execute()
cur_round = optimizer.round + 1 if not initial else optimizer.round
cur_round = optimizer.round
new_data = {"round": cur_round, "answers": answers, "prompt": optimizer.prompt}