Update src/populate.py
Browse files- src/populate.py +0 -7
src/populate.py
CHANGED
|
@@ -13,20 +13,13 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
| 13 |
raw_data = get_raw_eval_results(results_path, requests_path)
|
| 14 |
all_data_json = [v.to_dict() for v in raw_data]
|
| 15 |
|
| 16 |
-
print(all_data_json)
|
| 17 |
-
|
| 18 |
df = pd.DataFrame.from_records(all_data_json)
|
| 19 |
-
print(df)
|
| 20 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False) if AutoEvalColumn.average.name in df.columns else df
|
| 21 |
-
print(df.columns)
|
| 22 |
filtered_cols = [col for col in cols if col in df.columns]
|
| 23 |
-
print(filtered_cols)
|
| 24 |
df = df[filtered_cols].round(decimals=2)
|
| 25 |
-
print(df)
|
| 26 |
|
| 27 |
# filter out if any of the benchmarks have not been produced
|
| 28 |
filtered_benchmark_cols = [col for col in benchmark_cols if col in df.columns]
|
| 29 |
-
print(filtered_benchmark_cols)
|
| 30 |
df = df[has_no_nan_values(df, filtered_benchmark_cols)]
|
| 31 |
return df
|
| 32 |
|
|
|
|
| 13 |
raw_data = get_raw_eval_results(results_path, requests_path)
|
| 14 |
all_data_json = [v.to_dict() for v in raw_data]
|
| 15 |
|
|
|
|
|
|
|
| 16 |
df = pd.DataFrame.from_records(all_data_json)
|
|
|
|
| 17 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False) if AutoEvalColumn.average.name in df.columns else df
|
|
|
|
| 18 |
filtered_cols = [col for col in cols if col in df.columns]
|
|
|
|
| 19 |
df = df[filtered_cols].round(decimals=2)
|
|
|
|
| 20 |
|
| 21 |
# filter out if any of the benchmarks have not been produced
|
| 22 |
filtered_benchmark_cols = [col for col in benchmark_cols if col in df.columns]
|
|
|
|
| 23 |
df = df[has_no_nan_values(df, filtered_benchmark_cols)]
|
| 24 |
return df
|
| 25 |
|