LVU_Leaderboard / utils.py
wentao
update
e783f64
raw
history blame contribute delete
638 Bytes
import os
import json
import pandas as pd
from constants import RESULTS_DIR, CATEGORY_MAP
def load_all_results():
all_data = []
for file in os.listdir(RESULTS_DIR):
if file.endswith(".json"):
with open(os.path.join(RESULTS_DIR, file), "r") as f:
data = json.load(f)
for entry in data:
model = entry["Model"]
size, category = CATEGORY_MAP.get(model, ("N/A", "Unknown"))
entry["Size"] = size
entry["Category"] = category
all_data.append(entry)
return pd.DataFrame(all_data)