Update GitNore

This commit is contained in:
didi 2024-07-27 01:57:06 +08:00
parent 772d2aea56
commit eac4b6c3e6
30 changed files with 939 additions and 9 deletions

View file

@ -28,8 +28,9 @@ async def sample_generate(id, result_path:str="samples.jsonl",mode:str="ags"):
solution_result = await solver.alpha_codium(case['task_id'], case['prompt'], ensemble_count=5)
sample_dict = dict(task_id=case['task_id'], solution=solution_result['final_solution'])
elif mode == "llm":
solution_result = await generate_code_block(case['prompt'])
solution_result = await generate_code_block(case['prompt'],case['entry_point'])
sample_dict = dict(task_id=case['task_id'], solution=solution_result['code_solution'])
print(sample_dict)
with open(result_path, mode='a') as f:
f.write(json.dumps(sample_dict) + '\n')
jsonl_ranker(result_path, result_path)

View file

@ -62,6 +62,7 @@ class HumanEvalGraph(Graph):
except Exception as e:
print(e)
solution = await self.mdensemble("code", solution_list, problem)
print("here",solution)
solution = await self.tester(problem, rephrase_problem, solution, test_cases)
return solution

View file

@ -332,6 +332,8 @@ class Test(Operator):
except AssertionError as e:
fail_case.append(self.test_cases_2_assert(test_case))
except Exception as e:
with open("tester.txt", "a") as f:
f.write(test_case[0] + "\n")
print(e)
return {"error":e}
if fail_case != []:

View file

@ -55,9 +55,22 @@ You are given a code contest problem, and a self-reflection on the problem:
The above is an incomplete Python code fragment and reflection on it. Return the complete and correct code with no additional text.
"""
GENERATE_CODEBLOCK_PROMPT = """
Please provide a self-contained Python script that solves the following problem in a markdown code block:
# GENERATE_CODEBLOCK_PROMPT = """
# Please provide a self-contained Python script that solves the following problem in a markdown code block:
# {problem_description}
# """
GENERATE_CODEBLOCK_PROMPT ="""
Please provide a self-contained Python script that solves the following problem in a markdown code block:
{problem_description}
When creating your solution:
1. Consider all edge cases and boundary conditions.
2. Consider the order of operations in your solution and how each step affects subsequent steps.
3. Avoid oversimplification - address all aspects of the problem.
4. Ensure your logic covers all stated requirements.
5. Avoid adding additional test cases beyond those provided in the problem description.
"""
REVIEW_PROMPT = """

View file

@ -159,6 +159,7 @@ async def llm_extract_test_case(id, problem_description: str, file_path:str="pub
import json
def test_cases_2_test_functions(solution: str, test_case: List):
print("here",solution)
function_name = test_case[0]
def format_param(param):
@ -181,6 +182,7 @@ def test_cases_2_test_functions(solution: str, test_case: List):
print(type(test_case[2]), test_case[2])
expected_output = format_param(test_case[2])
print(expected_output)
tester_function = f"""
{solution}