diff --git a/evals/cli/oaieval.py b/evals/cli/oaieval.py index a8927dda4c..e48a09ac19 100644 --- a/evals/cli/oaieval.py +++ b/evals/cli/oaieval.py @@ -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}. Eval results will be reported and are not affected.") recorder.record_final_report(result) if not (args.dry_run or args.local_run):