Spaces:
Running
Running
tangxuemei
commited on
- src/leaderboard/read_evals.py +16 -10
src/leaderboard/read_evals.py
CHANGED
@@ -149,20 +149,26 @@ def get_request_file_for_model(requests_path, model_name, precision):
|
|
149 |
def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResult]:
|
150 |
"""From the path of the results folder root, extract all needed info for results"""
|
151 |
model_result_filepaths = []
|
152 |
-
|
153 |
for root, _, files in os.walk(results_path):
|
154 |
# We should only have json files in model results
|
155 |
-
|
156 |
-
continue
|
157 |
-
|
158 |
-
# Sort the files by date
|
159 |
-
try:
|
160 |
-
files.sort(key=lambda x: x.removesuffix(".json").removeprefix("results_")[:-7])
|
161 |
-
except dateutil.parser._parser.ParserError:
|
162 |
-
files = [files[-1]]
|
163 |
|
164 |
-
|
|
|
|
|
|
|
|
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
eval_results = {}
|
167 |
for model_result_filepath in model_result_filepaths:
|
168 |
# Creation of result
|
|
|
149 |
def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResult]:
|
150 |
"""From the path of the results folder root, extract all needed info for results"""
|
151 |
model_result_filepaths = []
|
152 |
+
print("results_path", results_path)
|
153 |
for root, _, files in os.walk(results_path):
|
154 |
# We should only have json files in model results
|
155 |
+
print("file",files)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
|
157 |
+
# if not files or any([not f.endswith(".json") for f in files]):
|
158 |
+
|
159 |
+
# continue
|
160 |
+
for f in files:
|
161 |
+
if f.endswith(".json"):
|
162 |
|
163 |
+
# Sort the files by date
|
164 |
+
# try:
|
165 |
+
# files.sort(key=lambda x: x.removesuffix(".json").removeprefix("results_")[:-7])
|
166 |
+
# except dateutil.parser._parser.ParserError:
|
167 |
+
# files = [files[-1]]
|
168 |
+
|
169 |
+
model_result_filepaths.extend([os.path.join(root, f)])
|
170 |
+
print("model_result_filepaths", model_result_filepaths)
|
171 |
+
# exit()
|
172 |
eval_results = {}
|
173 |
for model_result_filepath in model_result_filepaths:
|
174 |
# Creation of result
|