Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
print missing metadata models
Browse files
src/leaderboard/read_evals.py
CHANGED
@@ -29,7 +29,7 @@ class EvalResult:
|
|
29 |
license: str = "?"
|
30 |
lang: str = "?"
|
31 |
likes: int = 0
|
32 |
-
num_params: int =
|
33 |
date: str = "" # submission date of request file
|
34 |
still_on_hub: bool = False
|
35 |
n_shot: NShotType = NShotType.n0
|
@@ -61,6 +61,7 @@ class EvalResult:
|
|
61 |
|
62 |
org_and_model = re.sub(r"^pretrained=", "", org_and_model)
|
63 |
org_and_model = org_and_model.replace(",trust_remote_code=True", "")
|
|
|
64 |
|
65 |
org_and_model = org_and_model.split("/", 1)
|
66 |
|
@@ -118,7 +119,7 @@ class EvalResult:
|
|
118 |
try:
|
119 |
meta=metadata[self.full_model]
|
120 |
self.model_type = ModelType.from_str(meta.get("type", "?"))
|
121 |
-
self.num_params = meta.get("params",
|
122 |
self.license = meta.get("license", "?")
|
123 |
self.lang = meta.get("lang", "?")
|
124 |
#TODO desc name
|
@@ -359,6 +360,7 @@ def get_raw_eval_results(results_path: str, requests_path: str, metadata) -> lis
|
|
359 |
continue
|
360 |
|
361 |
missing_results_for_task = {}
|
|
|
362 |
for v in eval_results.values():
|
363 |
r = v.to_dict()
|
364 |
for task in Tasks:
|
@@ -368,11 +370,18 @@ def get_raw_eval_results(results_path: str, requests_path: str, metadata) -> lis
|
|
368 |
missing_results_for_task[task_name].append(f"{v.full_model}|{v.org_and_model}")
|
369 |
else:
|
370 |
missing_results_for_task[task_name] = [f"{v.full_model}|{v.org_and_model}"]
|
|
|
|
|
371 |
|
372 |
# print('missing_results_for_task', missing_results_for_task)
|
373 |
for task, models in missing_results_for_task.items():
|
374 |
print(f"Missing results for {task} for {len(models)} models")
|
375 |
print(" ".join(models))
|
376 |
|
|
|
|
|
|
|
|
|
|
|
377 |
|
378 |
return results
|
|
|
29 |
license: str = "?"
|
30 |
lang: str = "?"
|
31 |
likes: int = 0
|
32 |
+
num_params: int = None
|
33 |
date: str = "" # submission date of request file
|
34 |
still_on_hub: bool = False
|
35 |
n_shot: NShotType = NShotType.n0
|
|
|
61 |
|
62 |
org_and_model = re.sub(r"^pretrained=", "", org_and_model)
|
63 |
org_and_model = org_and_model.replace(",trust_remote_code=True", "")
|
64 |
+
org_and_model = re.sub(",prefix_token_id=\d+", "", org_and_model)
|
65 |
|
66 |
org_and_model = org_and_model.split("/", 1)
|
67 |
|
|
|
119 |
try:
|
120 |
meta=metadata[self.full_model]
|
121 |
self.model_type = ModelType.from_str(meta.get("type", "?"))
|
122 |
+
self.num_params = meta.get("params", None)
|
123 |
self.license = meta.get("license", "?")
|
124 |
self.lang = meta.get("lang", "?")
|
125 |
#TODO desc name
|
|
|
360 |
continue
|
361 |
|
362 |
missing_results_for_task = {}
|
363 |
+
missing_metadata = []
|
364 |
for v in eval_results.values():
|
365 |
r = v.to_dict()
|
366 |
for task in Tasks:
|
|
|
370 |
missing_results_for_task[task_name].append(f"{v.full_model}|{v.org_and_model}")
|
371 |
else:
|
372 |
missing_results_for_task[task_name] = [f"{v.full_model}|{v.org_and_model}"]
|
373 |
+
if r[AutoEvalColumn.lang.name] is None or r[AutoEvalColumn.lang.name]=="?":
|
374 |
+
missing_metadata.append(f"{v.full_model}")
|
375 |
|
376 |
# print('missing_results_for_task', missing_results_for_task)
|
377 |
for task, models in missing_results_for_task.items():
|
378 |
print(f"Missing results for {task} for {len(models)} models")
|
379 |
print(" ".join(models))
|
380 |
|
381 |
+
print(f"Missing metadata for {len(missing_metadata)} models")
|
382 |
+
for model in missing_metadata:
|
383 |
+
print(model)
|
384 |
+
print()
|
385 |
+
|
386 |
|
387 |
return results
|