Skip to content

Commit f8f0cff

Browse files
committed
Update codemmlu leaderboard
1 parent 5fe541d commit f8f0cff

File tree

7 files changed

+1702
-1339
lines changed

7 files changed

+1702
-1339
lines changed

codemmlu/index.html

Lines changed: 523 additions & 292 deletions
Large diffs are not rendered by default.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import csv
2+
import json
3+
import os
4+
5+
def convert_csv_to_json(csv_path, json_path):
6+
# Dictionary to store the results
7+
results = {}
8+
9+
# Read CSV file
10+
with open(csv_path, 'r') as csv_file:
11+
csv_reader = csv.DictReader(csv_file)
12+
13+
for row in csv_reader:
14+
model_name = row['model'].strip()
15+
16+
# Create model entry
17+
model_entry = {
18+
"link": model_name,
19+
"open-data": "None",
20+
"pass@1": {
21+
"instruct": None,
22+
"complete": float(row['codemmlu'])
23+
},
24+
"realtask_accuracy": float(row['fundamental']),
25+
"syntactic_accuracy": float(row['syntatic']),
26+
"semantic_accuracy": float(row['semantic']),
27+
"prompted": True, # Instruction models
28+
"size": float(row['size']) if row['size'] else None,
29+
"direct_complete": False,
30+
"lazy": False,
31+
"elo_mle": 874
32+
}
33+
34+
results[model_name] = model_entry
35+
36+
# Write JSON file
37+
with open(json_path, 'w') as json_file:
38+
json.dump(results, json_file, indent=4)
39+
40+
def main():
41+
# Get the absolute path to the script's directory
42+
script_dir = os.path.dirname(os.path.abspath(__file__))
43+
44+
# Construct paths relative to the script directory
45+
csv_path = os.path.join(script_dir, '..', 'static', 'data', 'CodeMMLU_update_res.csv')
46+
json_path = os.path.join(script_dir, '..', 'static', 'data', 'updated_results.json')
47+
48+
# Convert CSV to JSON
49+
convert_csv_to_json(csv_path, json_path)
50+
print(f"Conversion complete. JSON file saved to: {json_path}")
51+
52+
if __name__ == "__main__":
53+
main()
File renamed without changes.

0 commit comments

Comments
 (0)