Skip to content

Commit

Permalink
Add average mmlu accuracy (#287)
Browse files Browse the repository at this point in the history
Signed-off-by: Akshay Sonawane <[email protected]>
Co-authored-by: Jeremy Fowers <[email protected]>
  • Loading branch information
apsonawane and jeremyfowers authored Feb 4, 2025
1 parent 0989a7d commit d43e50f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lemonade/tools/mmlu.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,13 @@ def run(
state.save_stat(stat_units_name, "%")
self.status_stats.append(stat_name)

# Calculate average of mmlu accuracy and display in the CLI
acc_avg = np.mean([accuracy_data["Accuracy"] for accuracy_data in summary_data])
avg_stat_name = "avg_accuracy"
state.save_stat(avg_stat_name, float(acc_avg) * 100)
state.save_stat("accuracy_units", "%")
self.status_stats.append(avg_stat_name)

# Save accuracy results to CSV file
summary_df = pd.DataFrame(summary_data)
summary_df.to_csv(
Expand Down

0 comments on commit d43e50f

Please sign in to comment.