Spaces:
Runtime error
Runtime error
change condition
Browse files- src/populate.py +5 -3
src/populate.py
CHANGED
|
@@ -13,11 +13,13 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
| 13 |
all_data_json = [v.to_dict() for v in raw_data]
|
| 14 |
|
| 15 |
df = pd.DataFrame.from_records(all_data_json)
|
| 16 |
-
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
# filter out if any of the benchmarks have not been produced
|
| 20 |
-
|
|
|
|
| 21 |
return raw_data, df
|
| 22 |
|
| 23 |
|
|
|
|
| 13 |
all_data_json = [v.to_dict() for v in raw_data]
|
| 14 |
|
| 15 |
df = pd.DataFrame.from_records(all_data_json)
|
| 16 |
+
if len(df)>0:
|
| 17 |
+
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
| 18 |
+
df = df[cols].round(decimals=2)
|
| 19 |
|
| 20 |
# filter out if any of the benchmarks have not been produced
|
| 21 |
+
df = df[has_no_nan_values(df, benchmark_cols)]
|
| 22 |
+
|
| 23 |
return raw_data, df
|
| 24 |
|
| 25 |
|