Skip to content

Commit

Permalink
fix cases when some categories are empty
Browse files Browse the repository at this point in the history
  • Loading branch information
ArdalanM authored Jan 28, 2025
1 parent f0f1972 commit 671a3f8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion OCRBench_v2/eval_scripts/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ def process_predictions(input_path, output_path):
total_len += 1
mean_score += item["score"]

mean_score = mean_score / total_len
mean_score = mean_score / total_len if total_len > 0 else 0
print(f"Task {task_name}, total instructions: {total_len}, average score: {mean_score:.3f}\n")

with open(output_path, 'w', encoding='utf-8') as file:
Expand Down

0 comments on commit 671a3f8

Please sign in to comment.