danielz02
commited on
Commit
•
fe4b1fa
1
Parent(s):
d629841
Add revision to request file search
Browse files
src/leaderboard/read_evals.py
CHANGED
@@ -91,7 +91,9 @@ class EvalResult:
|
|
91 |
|
92 |
def update_with_request_file(self, requests_path):
|
93 |
"""Finds the relevant request file for the current model and updates info with it"""
|
94 |
-
request_file = get_request_file_for_model(
|
|
|
|
|
95 |
|
96 |
try:
|
97 |
with open(request_file, "r") as f:
|
@@ -133,12 +135,18 @@ class EvalResult:
|
|
133 |
return data_dict
|
134 |
|
135 |
|
136 |
-
def get_request_file_for_model(requests_path, model_name, precision):
|
137 |
"""Selects the correct request file for a given model. Only keeps runs tagged as FINISHED"""
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
142 |
print(f"Looking up request file(s) with pattern {request_files}")
|
143 |
request_files = glob.glob(request_files)
|
144 |
print(f"Found request file(s) {request_files}")
|
|
|
91 |
|
92 |
def update_with_request_file(self, requests_path):
|
93 |
"""Finds the relevant request file for the current model and updates info with it"""
|
94 |
+
request_file = get_request_file_for_model(
|
95 |
+
requests_path, self.full_model, self.precision.value.name, self.revision
|
96 |
+
)
|
97 |
|
98 |
try:
|
99 |
with open(request_file, "r") as f:
|
|
|
135 |
return data_dict
|
136 |
|
137 |
|
138 |
+
def get_request_file_for_model(requests_path, model_name, precision, revision=""):
|
139 |
"""Selects the correct request file for a given model. Only keeps runs tagged as FINISHED"""
|
140 |
+
if revision and revision != "main":
|
141 |
+
request_files = os.path.join(
|
142 |
+
requests_path,
|
143 |
+
f"{model_name}-{revision}_eval_request_*.json",
|
144 |
+
)
|
145 |
+
else:
|
146 |
+
request_files = os.path.join(
|
147 |
+
requests_path,
|
148 |
+
f"{model_name}_eval_request_*.json",
|
149 |
+
)
|
150 |
print(f"Looking up request file(s) with pattern {request_files}")
|
151 |
request_files = glob.glob(request_files)
|
152 |
print(f"Found request file(s) {request_files}")
|