File size: 888 Bytes
8c49cb6
 
 
 
 
df66f6e
314f91a
8c49cb6
d9f262c
8c49cb6
 
d9f262c
 
88477a4
d9f262c
95e674a
4c839ed
88477a4
 
35850bf
88477a4
d9f262c
35850bf
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import json
import os

import pandas as pd

from src.display.formatting import has_no_nan_values, make_clickable_model
from src.display.utils import AutoEvalColumn, EvalQueueColumn

from datasets import load_dataset, get_dataset_config_names


def get_leaderboard_df(results_repo):
    subsets = get_dataset_config_names(results_repo)
    subset_dfs = {}
    for subset in subsets:
        subset_data = load_dataset(results_repo, subset, split="test")
        subset_df = subset_data.to_pandas()
        subset_df = subset_df.sort_values(by="Total", ascending=False)
        subset_df = subset_df.round(2)  # Round all numeric columns to two decimal places
        # subset_df["Dataset Version"] = [subset] * len(subset_df)
        print(subset_df)
        subset_dfs[subset] = subset_df
    # df = pd.concat(subset_dfs.values())
    # return df, subset_dfs.keys()
    return subset_dfs