danielz02
commited on
Code formatting
Browse files
src/leaderboard/read_evals.py
CHANGED
@@ -14,20 +14,20 @@ from src.submission.check_validity import is_model_on_hub
|
|
14 |
|
15 |
@dataclass
|
16 |
class EvalResult:
|
17 |
-
eval_name: str
|
18 |
-
full_model: str
|
19 |
org: str
|
20 |
model: str
|
21 |
-
revision: str
|
22 |
results: dict
|
23 |
precision: Precision = Precision.Unknown
|
24 |
-
model_type: ModelType = ModelType.Unknown
|
25 |
-
weight_type: WeightType = WeightType.Original
|
26 |
architecture: str = "Unknown"
|
27 |
license: str = "?"
|
28 |
likes: int = 0
|
29 |
num_params: int = 0
|
30 |
-
date: str = ""
|
31 |
still_on_hub: bool = False
|
32 |
|
33 |
@classmethod
|
@@ -37,6 +37,7 @@ class EvalResult:
|
|
37 |
data = json.load(fp)
|
38 |
|
39 |
config = data.get("config")
|
|
|
40 |
|
41 |
# Precision
|
42 |
precision = Precision.from_str(config.get("model_dtype"))
|
@@ -84,7 +85,7 @@ class EvalResult:
|
|
84 |
model=model,
|
85 |
results=results,
|
86 |
precision=precision,
|
87 |
-
revision=
|
88 |
still_on_hub=still_on_hub,
|
89 |
architecture=architecture
|
90 |
)
|
@@ -117,7 +118,8 @@ class EvalResult:
|
|
117 |
AutoEvalColumn.architecture.name: self.architecture,
|
118 |
AutoEvalColumn.model.name: make_clickable_model(self.full_model),
|
119 |
AutoEvalColumn.dummy.name: self.full_model,
|
120 |
-
AutoEvalColumn.
|
|
|
121 |
AutoEvalColumn.average.name: average,
|
122 |
AutoEvalColumn.license.name: self.license,
|
123 |
AutoEvalColumn.likes.name: self.likes,
|
|
|
14 |
|
15 |
@dataclass
|
16 |
class EvalResult:
|
17 |
+
eval_name: str # org_model_precision (uid)
|
18 |
+
full_model: str # org/model (path on hub)
|
19 |
org: str
|
20 |
model: str
|
21 |
+
revision: str # commit hash, "" if main
|
22 |
results: dict
|
23 |
precision: Precision = Precision.Unknown
|
24 |
+
model_type: ModelType = ModelType.Unknown # Pretrained, fine tuned, ...
|
25 |
+
weight_type: WeightType = WeightType.Original # Original or Adapter
|
26 |
architecture: str = "Unknown"
|
27 |
license: str = "?"
|
28 |
likes: int = 0
|
29 |
num_params: int = 0
|
30 |
+
date: str = "" # submission date of request file
|
31 |
still_on_hub: bool = False
|
32 |
|
33 |
@classmethod
|
|
|
37 |
data = json.load(fp)
|
38 |
|
39 |
config = data.get("config")
|
40 |
+
print(config)
|
41 |
|
42 |
# Precision
|
43 |
precision = Precision.from_str(config.get("model_dtype"))
|
|
|
85 |
model=model,
|
86 |
results=results,
|
87 |
precision=precision,
|
88 |
+
revision=config.get("model_sha", ""),
|
89 |
still_on_hub=still_on_hub,
|
90 |
architecture=architecture
|
91 |
)
|
|
|
118 |
AutoEvalColumn.architecture.name: self.architecture,
|
119 |
AutoEvalColumn.model.name: make_clickable_model(self.full_model),
|
120 |
AutoEvalColumn.dummy.name: self.full_model,
|
121 |
+
AutoEvalColumn.
|
122 |
+
revision.name: self.revision,
|
123 |
AutoEvalColumn.average.name: average,
|
124 |
AutoEvalColumn.license.name: self.license,
|
125 |
AutoEvalColumn.likes.name: self.likes,
|