mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
Update
This commit is contained in:
parent
4af2315c77
commit
eb97b54a20
4 changed files with 16 additions and 11 deletions
|
|
@ -21,7 +21,7 @@ solver = HumanEvalGraph(name="solver", llm=LLM(), criteria='correctness, efficie
|
|||
|
||||
async def sample_generate(id):
|
||||
case = get_human_eval_plus()[f"{id}"]
|
||||
solution_result = await solver(case['prompt'],ensemble_count=5)
|
||||
solution_result = await solver(case['prompt'],ensemble_count=3)
|
||||
sample_dict = dict(task_id=case['task_id'], solution=solution_result['final_solution'])
|
||||
with open("samples.jsonl", mode='a') as f:
|
||||
f.write(json.dumps(sample_dict) + '\n')
|
||||
|
|
@ -153,6 +153,7 @@ def extract_failure_tests(file_path:str = "/Users/trl/Github_project/MetaGPT-Mat
|
|||
|
||||
|
||||
# asyncio.run(sample_generate('HumanEval/101'))
|
||||
# asyncio.run(samples_generate(mode='llm'))
|
||||
# asyncio.run(samples_generate(mode='ags'))
|
||||
# jsonl_ranker("samples.jsonl", "samples.jsonl")
|
||||
# {"task_id": "HumanEval/101", "solution": "def words_string(s):\n import re\n return re.split(r'[,\\s]\\s*', s)"}
|
||||
# {"task_id": "HumanEval/101", "solution": "def words_string(s):\n import re\n return re.split(r'[,\\s]\\s*', s)"}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,9 +25,5 @@ class EnsembleOp(BaseModel):
|
|||
final_solution: str = Field(default="", description="Final ensemble solution for this problem")
|
||||
|
||||
class MdEnsembleOp(BaseModel):
|
||||
thought: str = Field(default="",
|
||||
description="Analyze the solutions and think what's the best step by step.")
|
||||
solution_letter: str = Field(default="",
|
||||
description="""
|
||||
Based on the problem and solution candidates, carefully analyze which is the best answer. Focus solely on the correctness of the solution in addressing the problem.
|
||||
Provide your final decision by writing the chosen solution number. (eg.A) """)
|
||||
thought: str = Field(default="", description="Analyze the solutions and think what's the best step by step.")
|
||||
solution_letter: str = Field(default="", description="Choose The Best Solution, and output only one solution letter")
|
||||
|
|
@ -66,4 +66,7 @@ MD_ENSEMBLE_PROMPT = """
|
|||
<solutions>
|
||||
{solutions}
|
||||
</solutions>
|
||||
|
||||
### Instructions
|
||||
Based on the problem and solution candidates, carefully analyze which is the best answer. Focus solely on the correctness of the solution in addressing the problem. Provide your final decision by writing the chosen solution number. (eg.B). Keep the json format.
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue