Skip to content

Commit

Permalink
code_eval update
Browse files Browse the repository at this point in the history
  • Loading branch information
thomwolf committed Nov 1, 2023
1 parent 2e6decc commit 9987354
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 2 additions & 0 deletions bigcode_eval/tasks/custom_metrics/code_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ def compute_code_eval(predictions, references, k=[1, 10, 100], num_workers=4, ti
correct = np.array(correct)

ks = k
if not isinstance(ks, (list, tuple)):
ks = [ks]
pass_at_k = {f"pass@{k}": estimate_pass_at_k(total, correct, k).mean() for k in ks if (total >= k).all()}

return pass_at_k, results
Expand Down
1 change: 0 additions & 1 deletion bigcode_eval/tasks/custom_metrics/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def unsafe_execute(check_program, result, timeout):
exec_globals = {}
# with swallow_io():
with time_limit(timeout):
print(check_program)
exec(check_program, exec_globals)
result.append("passed")
except TimeoutException:
Expand Down

0 comments on commit 9987354

Please sign in to comment.