Spaces:
Running
Running
Aaron Mueller
commited on
Commit
·
93233b6
1
Parent(s):
f21ebe8
testing
Browse files- src/leaderboard/read_evals.py +1 -4
- src/populate.py +7 -0
src/leaderboard/read_evals.py
CHANGED
@@ -71,14 +71,11 @@ class EvalResult:
|
|
71 |
results[task.benchmark] = task_result
|
72 |
else:
|
73 |
for task in Tasks:
|
74 |
-
print("task:", task)
|
75 |
task = task.value
|
76 |
-
print("task.value:", task)
|
77 |
task_result = _get_task_results(task)
|
78 |
if task_result is not None:
|
79 |
results[task.benchmark] = task_result
|
80 |
|
81 |
-
print(results)
|
82 |
return self(
|
83 |
eval_name=eval_name,
|
84 |
full_model=full_model,
|
@@ -148,7 +145,6 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
|
|
148 |
|
149 |
for root, _, files in os.walk(results_path):
|
150 |
# We should only have json files in model results
|
151 |
-
print(files)
|
152 |
if len(files) == 0 or any([not f.endswith(".json") for f in files]):
|
153 |
continue
|
154 |
|
@@ -182,4 +178,5 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
|
|
182 |
except KeyError: # not all eval values present
|
183 |
continue
|
184 |
|
|
|
185 |
return results
|
|
|
71 |
results[task.benchmark] = task_result
|
72 |
else:
|
73 |
for task in Tasks:
|
|
|
74 |
task = task.value
|
|
|
75 |
task_result = _get_task_results(task)
|
76 |
if task_result is not None:
|
77 |
results[task.benchmark] = task_result
|
78 |
|
|
|
79 |
return self(
|
80 |
eval_name=eval_name,
|
81 |
full_model=full_model,
|
|
|
145 |
|
146 |
for root, _, files in os.walk(results_path):
|
147 |
# We should only have json files in model results
|
|
|
148 |
if len(files) == 0 or any([not f.endswith(".json") for f in files]):
|
149 |
continue
|
150 |
|
|
|
178 |
except KeyError: # not all eval values present
|
179 |
continue
|
180 |
|
181 |
+
print(results, len(results))
|
182 |
return results
|
src/populate.py
CHANGED
@@ -12,6 +12,13 @@ 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 |
print(all_data_json)
|
17 |
df = pd.DataFrame.from_records(all_data_json)
|
|
|
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 |
+
all_data_json_filtered = []
|
16 |
+
for item in all_data_json:
|
17 |
+
if "VQA" in benchmark_cols and "VQA" in item:
|
18 |
+
all_data_json_filtered.append(item)
|
19 |
+
if "VQA" not in benchmark_cols and "VQA" not in item:
|
20 |
+
all_data_json_filtered.append(item)
|
21 |
+
all_data_json = all_data_json_filtered
|
22 |
|
23 |
print(all_data_json)
|
24 |
df = pd.DataFrame.from_records(all_data_json)
|