XufengDuan commited on
Commit
e29f2bd
1 Parent(s): 7cbe773

update scripts

Browse files
Files changed (1) hide show
  1. src/leaderboard/read_evals.py +16 -16
src/leaderboard/read_evals.py CHANGED
@@ -134,9 +134,9 @@ class EvalResult:
134
  print(self.full_model)
135
  #print(self.precision.value.name)
136
  request_file = get_request_file_for_model(requests_path, self.full_model)
137
- print("test the variable:",request_file)
138
- all_files = os.listdir(request_file)
139
- print("Files in the folder:", all_files)
140
 
141
 
142
  try:
@@ -184,22 +184,22 @@ def get_request_file_for_model(requests_path, model_name):
184
  """Selects the correct request file for a given model. Only keeps runs tagged as FINISHED"""
185
  request_files = os.path.join(
186
  requests_path,
187
- f"{model_name}_eval_request_*.json",
188
  )
189
- request_files = glob.glob(request_files)
190
 
191
  # Select correct request file (precision)
192
- request_file = ""
193
- request_files = sorted(request_files, reverse=True)
194
- for tmp_request_file in request_files:
195
- with open(tmp_request_file, "r") as f:
196
- req_content = json.load(f)
197
- # if (
198
- # req_content["status"] in ["FINISHED"]
199
- # and req_content["precision"] == precision.split(".")[-1]
200
- # ):
201
- # request_file = tmp_request_file
202
- return request_file
203
 
204
 
205
  def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResult]:
 
134
  print(self.full_model)
135
  #print(self.precision.value.name)
136
  request_file = get_request_file_for_model(requests_path, self.full_model)
137
+ print("file name:",request_file)
138
+ #all_files = os.listdir(request_file)
139
+ #print("Files in the folder:", all_files)
140
 
141
 
142
  try:
 
184
  """Selects the correct request file for a given model. Only keeps runs tagged as FINISHED"""
185
  request_files = os.path.join(
186
  requests_path,
187
+ f"{model_name}.json",
188
  )
189
+ #request_files = glob.glob(request_files)
190
 
191
  # Select correct request file (precision)
192
+ # request_file = ""
193
+ # request_files = sorted(request_files, reverse=True)
194
+ # for tmp_request_file in request_files:
195
+ # with open(tmp_request_file, "r") as f:
196
+ # req_content = json.load(f)
197
+ # # if (
198
+ # # req_content["status"] in ["FINISHED"]
199
+ # # and req_content["precision"] == precision.split(".")[-1]
200
+ # # ):
201
+ # # request_file = tmp_request_file
202
+ return request_files
203
 
204
 
205
  def get_raw_eval_results(results_path: str, requests_path: str) -> list[EvalResult]: