Spaces:
Runtime error
Runtime error
Aaron Mueller
commited on
Commit
·
70dcf65
1
Parent(s):
97a67ce
testing
Browse files- src/leaderboard/read_evals.py +5 -2
- src/populate.py +1 -3
src/leaderboard/read_evals.py
CHANGED
@@ -76,7 +76,7 @@ class EvalResult:
|
|
76 |
if task_result is not None:
|
77 |
results[task.benchmark] = task_result
|
78 |
|
79 |
-
|
80 |
return self(
|
81 |
eval_name=eval_name,
|
82 |
full_model=full_model,
|
@@ -144,11 +144,13 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
|
|
144 |
"""From the path of the results folder root, extract all needed info for results"""
|
145 |
model_result_filepaths = []
|
146 |
|
|
|
147 |
for root, _, files in os.walk(results_path):
|
148 |
# We should only have json files in model results
|
|
|
149 |
if len(files) == 0 or any([not f.endswith(".json") for f in files]):
|
150 |
continue
|
151 |
-
|
152 |
# Sort the files by date
|
153 |
try:
|
154 |
files.sort(key=lambda x: x.removesuffix(".json").removeprefix("results_")[:-7])
|
@@ -158,6 +160,7 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
|
|
158 |
for file in files:
|
159 |
model_result_filepaths.append(os.path.join(root, file))
|
160 |
|
|
|
161 |
eval_results = {}
|
162 |
for model_result_filepath in model_result_filepaths:
|
163 |
# Creation of result
|
|
|
76 |
if task_result is not None:
|
77 |
results[task.benchmark] = task_result
|
78 |
|
79 |
+
print(results)
|
80 |
return self(
|
81 |
eval_name=eval_name,
|
82 |
full_model=full_model,
|
|
|
144 |
"""From the path of the results folder root, extract all needed info for results"""
|
145 |
model_result_filepaths = []
|
146 |
|
147 |
+
print(results_path)
|
148 |
for root, _, files in os.walk(results_path):
|
149 |
# We should only have json files in model results
|
150 |
+
print(files)
|
151 |
if len(files) == 0 or any([not f.endswith(".json") for f in files]):
|
152 |
continue
|
153 |
+
|
154 |
# Sort the files by date
|
155 |
try:
|
156 |
files.sort(key=lambda x: x.removesuffix(".json").removeprefix("results_")[:-7])
|
|
|
160 |
for file in files:
|
161 |
model_result_filepaths.append(os.path.join(root, file))
|
162 |
|
163 |
+
print(model_result_filepaths)
|
164 |
eval_results = {}
|
165 |
for model_result_filepath in model_result_filepaths:
|
166 |
# Creation of result
|
src/populate.py
CHANGED
@@ -13,10 +13,8 @@ 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 |
print(raw_data)
|
15 |
all_data_json = [v.to_dict() for v in raw_data]
|
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)
|
21 |
df = df[cols].round(decimals=1)
|
22 |
|
@@ -25,7 +23,7 @@ def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchm
|
|
25 |
return df
|
26 |
|
27 |
def get_evaluation_queue_df(save_path: str, cols: list) -> list[pd.DataFrame]:
|
28 |
-
"""Creates the different dataframes for the evaluation queues
|
29 |
entries = [entry for entry in os.listdir(save_path) if not entry.startswith(".")]
|
30 |
all_evals = []
|
31 |
|
|
|
13 |
raw_data = get_raw_eval_results(results_path, requests_path)
|
14 |
print(raw_data)
|
15 |
all_data_json = [v.to_dict() for v in raw_data]
|
|
|
16 |
|
17 |
df = pd.DataFrame.from_records(all_data_json)
|
|
|
18 |
# df = df.sort_values(by=[AutoEvalColumn.average.name], ascending=False)
|
19 |
df = df[cols].round(decimals=1)
|
20 |
|
|
|
23 |
return df
|
24 |
|
25 |
def get_evaluation_queue_df(save_path: str, cols: list) -> list[pd.DataFrame]:
|
26 |
+
"""Creates the different dataframes for the evaluation queues requests"""
|
27 |
entries = [entry for entry in os.listdir(save_path) if not entry.startswith(".")]
|
28 |
all_evals = []
|
29 |
|