XufengDuan commited on
Commit
27d8f5d
1 Parent(s): 2f756c5

update scripts

Browse files
Files changed (1) hide show
  1. src/leaderboard/read_evals.py +7 -7
src/leaderboard/read_evals.py CHANGED
@@ -83,9 +83,9 @@ class EvalResult:
83
  for k, v in data["results"].items():
84
  if task.benchmark == k:
85
  if isinstance(v, (int, float)) and not math.isnan(v):
86
- accs.append(np.around(v * 100, decimals=0))
87
  elif isinstance(v, list):
88
- accs.extend([np.around(x * 100, decimals=0) for x in v if
89
  isinstance(x, (int, float)) and not math.isnan(x)])
90
  else:
91
  # 跳过 NaN 或不符合条件的值
@@ -130,10 +130,10 @@ class EvalResult:
130
  """Finds the relevant request file for the current model and updates info with it"""
131
  all_files_before = os.listdir(requests_path)
132
  print("test the variable:", all_files_before)
133
- print(self.full_model)
134
  #print(self.precision.value.name)
135
  request_file = get_request_file_for_model(requests_path, self.full_model)
136
- print("file name:",request_file)
137
  #all_files = os.listdir(request_file)
138
  #print("Files in the folder:", all_files)
139
 
@@ -211,15 +211,15 @@ def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResu
211
  for f in files:
212
  if f.endswith(".json"):
213
  model_result_filepaths.extend([os.path.join(root, f)])
214
- print("model_result_filepaths:", model_result_filepaths)
215
  # exit()
216
  eval_results = {}
217
  for model_result_filepath in model_result_filepaths:
218
  # Creation of result
219
  eval_result = EvalResult.init_from_json_file(model_result_filepath)
220
- print("request_path:",requests_path)
221
  eval_result.update_with_request_file(requests_path)
222
- print(eval_result)
223
 
224
  # Store results of same eval together
225
  eval_name = eval_result.eval_name
 
83
  for k, v in data["results"].items():
84
  if task.benchmark == k:
85
  if isinstance(v, (int, float)) and not math.isnan(v):
86
+ accs.append(np.around(v * 100, decimals=1))
87
  elif isinstance(v, list):
88
+ accs.extend([np.around(x * 100, decimals=1) for x in v if
89
  isinstance(x, (int, float)) and not math.isnan(x)])
90
  else:
91
  # 跳过 NaN 或不符合条件的值
 
130
  """Finds the relevant request file for the current model and updates info with it"""
131
  all_files_before = os.listdir(requests_path)
132
  print("test the variable:", all_files_before)
133
+ # print(self.full_model)
134
  #print(self.precision.value.name)
135
  request_file = get_request_file_for_model(requests_path, self.full_model)
136
+ # print("file name:",request_file)
137
  #all_files = os.listdir(request_file)
138
  #print("Files in the folder:", all_files)
139
 
 
211
  for f in files:
212
  if f.endswith(".json"):
213
  model_result_filepaths.extend([os.path.join(root, f)])
214
+ # print("model_result_filepaths:", model_result_filepaths)
215
  # exit()
216
  eval_results = {}
217
  for model_result_filepath in model_result_filepaths:
218
  # Creation of result
219
  eval_result = EvalResult.init_from_json_file(model_result_filepath)
220
+ # print("request_path:",requests_path)
221
  eval_result.update_with_request_file(requests_path)
222
+ # print(eval_result)
223
 
224
  # Store results of same eval together
225
  eval_name = eval_result.eval_name