lixuejing
commited on
Commit
·
1f6da98
1
Parent(s):
687ef23
fix
Browse files- app.py +1 -1
- src/leaderboard/read_evals.py +6 -1
- src/populate.py +2 -2
app.py
CHANGED
@@ -63,7 +63,7 @@ def init_space():
|
|
63 |
#leaderboard_df = get_leaderboard_df(
|
64 |
results_path=EVAL_RESULTS_PATH,
|
65 |
requests_path=EVAL_REQUESTS_PATH,
|
66 |
-
|
67 |
cols=COLS,
|
68 |
benchmark_cols=BENCHMARK_COLS
|
69 |
)
|
|
|
63 |
#leaderboard_df = get_leaderboard_df(
|
64 |
results_path=EVAL_RESULTS_PATH,
|
65 |
requests_path=EVAL_REQUESTS_PATH,
|
66 |
+
dynamic_path=DYNAMIC_INFO_FILE_PATH,
|
67 |
cols=COLS,
|
68 |
benchmark_cols=BENCHMARK_COLS
|
69 |
)
|
src/leaderboard/read_evals.py
CHANGED
@@ -181,7 +181,7 @@ def get_request_file_for_model(requests_path, model_name, precision):
|
|
181 |
return request_file
|
182 |
|
183 |
|
184 |
-
def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResult]:
|
185 |
"""From the path of the results folder root, extract all needed info for results"""
|
186 |
model_result_filepaths = []
|
187 |
|
@@ -199,11 +199,16 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
|
|
199 |
for file in files:
|
200 |
model_result_filepaths.append(os.path.join(root, file))
|
201 |
|
|
|
|
|
|
|
202 |
eval_results = {}
|
203 |
for model_result_filepath in model_result_filepaths:
|
204 |
# Creation of result
|
205 |
eval_result = EvalResult.init_from_json_file(model_result_filepath)
|
206 |
eval_result.update_with_request_file(requests_path)
|
|
|
|
|
207 |
|
208 |
# Store results of same eval together
|
209 |
eval_name = eval_result.eval_name
|
|
|
181 |
return request_file
|
182 |
|
183 |
|
184 |
+
def get_raw_eval_results(results_path: str, requests_path: str, dynamic_path: str) -> list[EvalResult]:
|
185 |
"""From the path of the results folder root, extract all needed info for results"""
|
186 |
model_result_filepaths = []
|
187 |
|
|
|
199 |
for file in files:
|
200 |
model_result_filepaths.append(os.path.join(root, file))
|
201 |
|
202 |
+
with open(dynamic_path) as f:
|
203 |
+
dynamic_data = json.load(f)
|
204 |
+
|
205 |
eval_results = {}
|
206 |
for model_result_filepath in model_result_filepaths:
|
207 |
# Creation of result
|
208 |
eval_result = EvalResult.init_from_json_file(model_result_filepath)
|
209 |
eval_result.update_with_request_file(requests_path)
|
210 |
+
if eval_result.full_model in dynamic_data:
|
211 |
+
eval_result.update_with_dynamic_file_dict(dynamic_data[eval_result.full_model])
|
212 |
|
213 |
# Store results of same eval together
|
214 |
eval_name = eval_result.eval_name
|
src/populate.py
CHANGED
@@ -9,9 +9,9 @@ from src.leaderboard.read_evals import get_raw_eval_results
|
|
9 |
from src.leaderboard.filter_models import filter_models_flags
|
10 |
|
11 |
|
12 |
-
def get_leaderboard_df(results_path: str, requests_path: str, cols: list, benchmark_cols: list) -> pd.DataFrame:
|
13 |
"""Creates a dataframe from all the individual experiment results"""
|
14 |
-
raw_data = get_raw_eval_results(results_path, requests_path)
|
15 |
all_data_json = [v.to_dict() for v in raw_data]
|
16 |
all_data_json.append(baseline_row)
|
17 |
filter_models_flags(all_data_json)
|
|
|
9 |
from src.leaderboard.filter_models import filter_models_flags
|
10 |
|
11 |
|
12 |
+
def get_leaderboard_df(results_path: str, requests_path: str, dynamic_path: str,cols: list, benchmark_cols: list) -> pd.DataFrame:
|
13 |
"""Creates a dataframe from all the individual experiment results"""
|
14 |
+
raw_data = get_raw_eval_results(results_path, requests_path, dynamic_path)
|
15 |
all_data_json = [v.to_dict() for v in raw_data]
|
16 |
all_data_json.append(baseline_row)
|
17 |
filter_models_flags(all_data_json)
|