MCPcopy Create free account
hub / github.com/SalesforceAIResearch/perfcodegen / process_solution

Method process_solution

src/evaluate.py:38–53  ·  view source on GitHub ↗
(self, solution, instance)

Source from the content-addressed store, hash-verified

36 return entry_point
37
38 def process_solution(self, solution, instance):
39 if self.dataset.name == "openai_humaneval" and not solution.startswith("def"):
40 lines = solution.splitlines()
41 if len(lines) > 0:
42 lines[0] = " " + lines[0]
43 solution = instance["prompt"] + "\n".join(lines)
44 elif self.dataset.name == "openai_humaneval":
45 try:
46 ast.parse(solution)
47 except:
48 lines = solution.splitlines()
49 if len(lines) > 0:
50 lines[0] = " " + lines[0]
51 solution = instance["prompt"] + "\n".join(lines)
52
53 return solution
54
55
56 def get_solutions(self, codegen = False, chat = False):

Callers 1

get_solutionsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected