Spaces:
Runtime error
Runtime error
chore: Refactor get_leaderboard_df to handle multiple subsets in populate.py
Browse files- src/populate.py +11 -7
src/populate.py
CHANGED
@@ -9,10 +9,14 @@ from src.display.utils import AutoEvalColumn, EvalQueueColumn
|
|
9 |
from datasets import load_dataset
|
10 |
|
11 |
|
12 |
-
def get_leaderboard_df(results_repo, results_path
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
9 |
from datasets import load_dataset
|
10 |
|
11 |
|
12 |
+
def get_leaderboard_df(results_repo, results_path):
|
13 |
+
subsets = load_dataset(results_repo, split='all', cache_dir=results_path)
|
14 |
+
subset_dfs = {}
|
15 |
+
print("Subsets:", subsets.keys())
|
16 |
+
for subset_name in subsets.keys():
|
17 |
+
subset_df = subsets[subset_name].to_pandas()
|
18 |
+
subset_df = subset_df.sort_values(by="Total", ascending=False)
|
19 |
+
subset_df = subset_df.round(2) # Round all numeric columns to two decimal places
|
20 |
+
print(subset_df)
|
21 |
+
subset_dfs[subset_name] = subset_df
|
22 |
+
return subset_dfs
|