mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-02 16:01:04 +02:00
Remove spo redundant code
This commit is contained in:
parent
2528f2bf5f
commit
424726eed9
6 changed files with 13 additions and 25 deletions
0
metagpt/ext/spo/components/__init__.py
Normal file
0
metagpt/ext/spo/components/__init__.py
Normal 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)
|
||||
|
|
|
|||
|
|
@ -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}"
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue