Spaces:
Runtime error
Runtime error
Update src/populate.py
Browse files- src/populate.py +10 -0
src/populate.py
CHANGED
@@ -9,13 +9,19 @@ from src.leaderboard.read_evals import get_raw_eval_results
|
|
9 |
|
10 |
|
11 |
def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchmark_cols: list) -> pd.DataFrame:
|
|
|
12 |
raw_data = get_raw_eval_results(results_path, requests_path)
|
|
|
|
|
13 |
all_data_json = [v.to_dict() for v in raw_data]
|
14 |
|
15 |
df = pd.DataFrame.from_records(all_data_json)
|
16 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
17 |
df = df[cols].round(decimals=2)
|
18 |
|
|
|
|
|
|
|
19 |
# filter out if any of the benchmarks have not been produced
|
20 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
21 |
return raw_data, df
|
@@ -25,8 +31,12 @@ def get_evaluation_queue_df(save_path: str, cols: list) -> list[pd.DataFrame]:
|
|
25 |
entries = [entry for entry in os.listdir(save_path) if not entry.startswith(".")]
|
26 |
all_evals = []
|
27 |
|
|
|
|
|
28 |
for entry in entries:
|
29 |
if ".json" in entry:
|
|
|
|
|
30 |
file_path = os.path.join(save_path, entry)
|
31 |
with open(file_path) as fp:
|
32 |
data = json.load(fp)
|
|
|
9 |
|
10 |
|
11 |
def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchmark_cols: list) -> pd.DataFrame:
|
12 |
+
print("before get_raw_eval_results") # blz
|
13 |
raw_data = get_raw_eval_results(results_path, requests_path)
|
14 |
+
print("after get_raw_eval_results") # blz
|
15 |
+
|
16 |
all_data_json = [v.to_dict() for v in raw_data]
|
17 |
|
18 |
df = pd.DataFrame.from_records(all_data_json)
|
19 |
df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
20 |
df = df[cols].round(decimals=2)
|
21 |
|
22 |
+
print("after df things") # blz
|
23 |
+
|
24 |
+
|
25 |
# filter out if any of the benchmarks have not been produced
|
26 |
df = df[has_no_nan_values(df, benchmark_cols)]
|
27 |
return raw_data, df
|
|
|
31 |
entries = [entry for entry in os.listdir(save_path) if not entry.startswith(".")]
|
32 |
all_evals = []
|
33 |
|
34 |
+
print("inside get_evaluation_queue_df") # blz
|
35 |
+
|
36 |
for entry in entries:
|
37 |
if ".json" in entry:
|
38 |
+
print(f"a json file {entry}") # blz
|
39 |
+
|
40 |
file_path = os.path.join(save_path, entry)
|
41 |
with open(file_path) as fp:
|
42 |
data = json.load(fp)
|