fix cases when some categories are empty

This commit is contained in:
Ardalan
2025-01-28 15:45:43 -08:00
committed by GitHub
parent f0f1972c6f
commit 671a3f88c9

View File

@@ -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: