Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update src/populate.py
Browse files- src/populate.py +9 -1
src/populate.py
CHANGED
@@ -12,23 +12,31 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
12 |
"""Creates a dataframe from all the individual experiment results"""
|
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 |
|
17 |
df = pd.DataFrame.from_records(all_data_json)
|
|
|
18 |
score_cols = [
|
19 |
'ALT E to J BLEU', 'ALT J to E BLEU', 'WikiCorpus E to J BLEU', 'WikiCorpus J to E BLEU',
|
20 |
'XL-Sum JA BLEU', 'XL-Sum ROUGE1', 'XL-Sum ROUGE2', 'XL-Sum ROUGE-Lsum'
|
21 |
]
|
22 |
|
23 |
existing_score_cols = [col for col in score_cols if col in df.columns]
|
|
|
24 |
|
25 |
# γΉγ³γ’εγ100γ§ε²γγ.4fε½’εΌγ§γγ©γΌγγγ
|
26 |
df[existing_score_cols] = (df[existing_score_cols] / 100).applymap(lambda x: f'{x:.4f}')
|
|
|
27 |
df = df.sort_values(by=[AutoEvalColumn.AVG.name], ascending=False)
|
28 |
df = df[cols].round(decimals=2)
|
29 |
-
|
|
|
30 |
# filter out if any of the benchmarks have not been produced
|
31 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
|
|
32 |
return df
|
33 |
|
34 |
|
|
|
12 |
"""Creates a dataframe from all the individual experiment results"""
|
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(f"All data JSON: {all_data_json}")
|
17 |
+
|
18 |
|
19 |
|
20 |
df = pd.DataFrame.from_records(all_data_json)
|
21 |
+
print(f"Initial DataFrame: {df}")
|
22 |
score_cols = [
|
23 |
'ALT E to J BLEU', 'ALT J to E BLEU', 'WikiCorpus E to J BLEU', 'WikiCorpus J to E BLEU',
|
24 |
'XL-Sum JA BLEU', 'XL-Sum ROUGE1', 'XL-Sum ROUGE2', 'XL-Sum ROUGE-Lsum'
|
25 |
]
|
26 |
|
27 |
existing_score_cols = [col for col in score_cols if col in df.columns]
|
28 |
+
print(f"Existing score columns: {existing_score_cols}")
|
29 |
|
30 |
# γΉγ³γ’εγ100γ§ε²γγ.4fε½’εΌγ§γγ©γΌγγγ
|
31 |
df[existing_score_cols] = (df[existing_score_cols] / 100).applymap(lambda x: f'{x:.4f}')
|
32 |
+
print(f"DataFrame after score adjustment: {df}")
|
33 |
df = df.sort_values(by=[AutoEvalColumn.AVG.name], ascending=False)
|
34 |
df = df[cols].round(decimals=2)
|
35 |
+
print(f"Sorted DataFrame: {df}")
|
36 |
+
|
37 |
# filter out if any of the benchmarks have not been produced
|
38 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
39 |
+
print(f"Final DataFrame after NaN filtering: {df}")
|
40 |
return df
|
41 |
|
42 |
|