Skip to content

Commit

Permalink
Merge pull request #46 from ArdalanM/patch-1
Browse files Browse the repository at this point in the history
fix cases when some categories are empty
  • Loading branch information
99Franklin authored Feb 14, 2025
2 parents f0f1972 + 671a3f8 commit b5ecad3
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 b5ecad3

Please sign in to comment.