Skip to content

Commit

Permalink
fix(inspect): avoid empty folder
Browse files Browse the repository at this point in the history
  • Loading branch information
terryyz committed Aug 2, 2024
1 parent 4ab7c7f commit 617b5bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bigcodebench/inspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def inspection(args):

eval_results = json.load(open(args.eval_results, "r"))
for task_id, results in eval_results["eval"].items():
if task_id not in problems:
continue
if all(result["status"] == "pass" for result in results):
continue
task_path = os.path.join(path, task_id)
if not os.path.exists(task_path):
os.makedirs(task_path)
if task_id not in problems:
continue
task_id_data = problems[task_id]
with open(os.path.join(task_path, "ground_truth.py"), "w") as f:
f.write(task_id_data[f"{args.split}_prompt"] + "\n\n" + task_id_data["canonical_solution"])
Expand Down

0 comments on commit 617b5bd

Please sign in to comment.