Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update src/populate.py
Browse files- src/populate.py +21 -0
src/populate.py
CHANGED
@@ -19,6 +19,27 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
19 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
20 |
df = df[cols].round(decimals=2)
|
21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
# filter out if any of the benchmarks have not been produced
|
23 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
24 |
return df
|
|
|
19 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
20 |
df = df[cols].round(decimals=2)
|
21 |
|
22 |
+
print(f"Number of raw results: {len(raw_data)}")
|
23 |
+
|
24 |
+
data = []
|
25 |
+
for v in raw_data:
|
26 |
+
try:
|
27 |
+
dict_data = v.to_dict()
|
28 |
+
print(f"Processed data: {dict_data}")
|
29 |
+
data.append(dict_data)
|
30 |
+
except Exception as e:
|
31 |
+
print(f"Error processing result: {e}")
|
32 |
+
|
33 |
+
print(f"Number of processed results: {len(data)}")
|
34 |
+
|
35 |
+
if not data:
|
36 |
+
print("No data to create DataFrame")
|
37 |
+
return None
|
38 |
+
|
39 |
+
df = pd.DataFrame(data)
|
40 |
+
print(f"DataFrame shape: {df.shape}")
|
41 |
+
print(f"DataFrame columns: {df.columns}")
|
42 |
+
|
43 |
# filter out if any of the benchmarks have not been produced
|
44 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
45 |
return df
|