Skip to content

Commit

Permalink
add exception handling
Browse files Browse the repository at this point in the history
  • Loading branch information
sjadler2004 committed Sep 30, 2024
1 parent 234bcde commit 2f38c39
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion evals/cli/oaieval.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ def to_number(x: str) -> Union[int, float, str]:
**extra_eval_params,
)
result = eval.run(recorder)
add_token_usage_to_result(result, recorder)
try:
add_token_usage_to_result(result, recorder)
except Exception as e:
logger.error(f"Failed to add token usage to result: {e}")
recorder.record_final_report(result)

if not (args.dry_run or args.local_run):
Expand Down

0 comments on commit 2f38c39

Please sign in to comment.