mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-01 03:46:23 +02:00
update ensemble example
This commit is contained in:
parent
f1ce1330d7
commit
4d376649cc
6 changed files with 53 additions and 230 deletions
23
he_test.py
23
he_test.py
|
|
@ -6,9 +6,13 @@ from examples.ags.w_action_node.graph import HumanEvalGraph
|
|||
from examples.ags.w_action_node.operator import GenerateCode
|
||||
|
||||
generate_code = GenerateCode(llm=LLM())
|
||||
case = get_human_eval_plus()['HumanEval/10']
|
||||
solver = HumanEvalGraph(name="solver", llm=LLM(), criteria='correctness, efficiency, readability')
|
||||
|
||||
|
||||
async def sample_generate(case):
|
||||
solution_result = await solver(case['prompt'])
|
||||
sample_dict = dict(task_id=case['task_id'], solution=solution_result['final_solution'])
|
||||
print(sample_dict)
|
||||
|
||||
async def samples_generate_sequence():
|
||||
sample_list = []
|
||||
|
|
@ -35,18 +39,6 @@ async def samples_generate_ags():
|
|||
|
||||
write_jsonl("samples.jsonl", sample_list)
|
||||
|
||||
# humanevalgraph result (review & revise -> ensemble)
|
||||
# humaneval (base tests)
|
||||
# pass@1: 0.823
|
||||
# humaneval+ (base + extra tests)
|
||||
# pass@1: 0.774
|
||||
|
||||
# deepseek result
|
||||
# humaneval (base tests)
|
||||
# pass@1: 0.841
|
||||
# humaneval+ (base + extra tests)
|
||||
# pass@1: 0.780
|
||||
|
||||
async def samples_generate_llm():
|
||||
sample_list = []
|
||||
cases = list(get_human_eval_plus().values())
|
||||
|
|
@ -64,5 +56,8 @@ async def samples_generate_llm():
|
|||
|
||||
write_jsonl("samples.jsonl", sample_list)
|
||||
|
||||
asyncio.run(samples_generate_llm())
|
||||
# asyncio.run(sample_generate(case))
|
||||
# asyncio.run(samples_generate_llm())
|
||||
asyncio.run(samples_generate_ags())
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue