Spaces:
Restarting
Restarting
lang
Browse files- src/backend/manage_requests.py +2 -1
- src/display/utils.py +5 -1
- src/leaderboard/read_evals.py +9 -1
src/backend/manage_requests.py
CHANGED
@@ -22,7 +22,8 @@ class EvalRequest:
|
|
22 |
likes: Optional[int] = 0
|
23 |
params: Optional[int] = None
|
24 |
license: Optional[str] = ""
|
25 |
-
|
|
|
26 |
def get_model_args(self):
|
27 |
model_args = f"pretrained={self.model},revision={self.revision}"
|
28 |
|
|
|
22 |
likes: Optional[int] = 0
|
23 |
params: Optional[int] = None
|
24 |
license: Optional[str] = ""
|
25 |
+
lang: Optional[str] = ""
|
26 |
+
|
27 |
def get_model_args(self):
|
28 |
model_args = f"pretrained={self.model},revision={self.revision}"
|
29 |
|
src/display/utils.py
CHANGED
@@ -34,11 +34,12 @@ auto_eval_column_dict.append(["average_mc", ColumnContent, ColumnContent("Avg mc
|
|
34 |
for task in Tasks:
|
35 |
auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])
|
36 |
# Model information
|
37 |
-
auto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type", "str",
|
38 |
auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
39 |
auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
40 |
auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])
|
41 |
auto_eval_column_dict.append(["license", ColumnContent, ColumnContent("Hub License", "str", False)])
|
|
|
42 |
auto_eval_column_dict.append(["params", ColumnContent, ColumnContent("#Params (B)", "number", True)])
|
43 |
auto_eval_column_dict.append(["likes", ColumnContent, ColumnContent("Hub ❤️", "number", False)])
|
44 |
auto_eval_column_dict.append(["still_on_hub", ColumnContent, ColumnContent("Available on the hub", "bool", False)])
|
@@ -72,6 +73,7 @@ class ModelType(Enum):
|
|
72 |
CPT = ModelDetails(name="continuously pretrained", symbol="🟩")
|
73 |
IFT = ModelDetails(name="instruction-tuned", symbol="⭕")
|
74 |
RL = ModelDetails(name="RL-tuned", symbol="💬")
|
|
|
75 |
Unknown = ModelDetails(name="", symbol="?")
|
76 |
|
77 |
def to_str(self, separator=" "):
|
@@ -87,6 +89,8 @@ class ModelType(Enum):
|
|
87 |
return ModelType.RL
|
88 |
if "instruction-tuned" in type or "⭕" in type:
|
89 |
return ModelType.IFT
|
|
|
|
|
90 |
return ModelType.Unknown
|
91 |
|
92 |
class WeightType(Enum):
|
|
|
34 |
for task in Tasks:
|
35 |
auto_eval_column_dict.append([task.name, ColumnContent, ColumnContent(task.value.col_name, "number", True)])
|
36 |
# Model information
|
37 |
+
auto_eval_column_dict.append(["model_type", ColumnContent, ColumnContent("Type", "str", False)])
|
38 |
auto_eval_column_dict.append(["architecture", ColumnContent, ColumnContent("Architecture", "str", False)])
|
39 |
auto_eval_column_dict.append(["weight_type", ColumnContent, ColumnContent("Weight type", "str", False, True)])
|
40 |
auto_eval_column_dict.append(["precision", ColumnContent, ColumnContent("Precision", "str", False)])
|
41 |
auto_eval_column_dict.append(["license", ColumnContent, ColumnContent("Hub License", "str", False)])
|
42 |
+
auto_eval_column_dict.append(["lang", ColumnContent, ColumnContent("Lang", "str", True)])
|
43 |
auto_eval_column_dict.append(["params", ColumnContent, ColumnContent("#Params (B)", "number", True)])
|
44 |
auto_eval_column_dict.append(["likes", ColumnContent, ColumnContent("Hub ❤️", "number", False)])
|
45 |
auto_eval_column_dict.append(["still_on_hub", ColumnContent, ColumnContent("Available on the hub", "bool", False)])
|
|
|
73 |
CPT = ModelDetails(name="continuously pretrained", symbol="🟩")
|
74 |
IFT = ModelDetails(name="instruction-tuned", symbol="⭕")
|
75 |
RL = ModelDetails(name="RL-tuned", symbol="💬")
|
76 |
+
Baseline = ModelDetails(name="baseline", symbol="⚖")
|
77 |
Unknown = ModelDetails(name="", symbol="?")
|
78 |
|
79 |
def to_str(self, separator=" "):
|
|
|
89 |
return ModelType.RL
|
90 |
if "instruction-tuned" in type or "⭕" in type:
|
91 |
return ModelType.IFT
|
92 |
+
if "baseline" in type or "⚖" in type:
|
93 |
+
return ModelType.IFT
|
94 |
return ModelType.Unknown
|
95 |
|
96 |
class WeightType(Enum):
|
src/leaderboard/read_evals.py
CHANGED
@@ -27,6 +27,7 @@ class EvalResult:
|
|
27 |
weight_type: WeightType = WeightType.Original # Original or Adapter
|
28 |
architecture: str = "Unknown"
|
29 |
license: str = "?"
|
|
|
30 |
likes: int = 0
|
31 |
num_params: int = 0
|
32 |
date: str = "" # submission date of request file
|
@@ -113,7 +114,7 @@ class EvalResult:
|
|
113 |
self.model_type = ModelType.from_str(meta.get("type", "?"))
|
114 |
self.num_params = meta.get("params", 0)
|
115 |
self.license = meta.get("license", "?")
|
116 |
-
|
117 |
#TODO desc name
|
118 |
except KeyError:
|
119 |
print(f"Could not find metadata for {self.full_model}")
|
@@ -239,6 +240,13 @@ class EvalResult:
|
|
239 |
except AttributeError:
|
240 |
print(f"AttributeError license")
|
241 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
242 |
try:
|
243 |
data_dict[AutoEvalColumn.likes.name] = self.likes
|
244 |
except KeyError:
|
|
|
27 |
weight_type: WeightType = WeightType.Original # Original or Adapter
|
28 |
architecture: str = "Unknown"
|
29 |
license: str = "?"
|
30 |
+
lang: str = "?"
|
31 |
likes: int = 0
|
32 |
num_params: int = 0
|
33 |
date: str = "" # submission date of request file
|
|
|
114 |
self.model_type = ModelType.from_str(meta.get("type", "?"))
|
115 |
self.num_params = meta.get("params", 0)
|
116 |
self.license = meta.get("license", "?")
|
117 |
+
self.lang = meta.get("lang", "?")
|
118 |
#TODO desc name
|
119 |
except KeyError:
|
120 |
print(f"Could not find metadata for {self.full_model}")
|
|
|
240 |
except AttributeError:
|
241 |
print(f"AttributeError license")
|
242 |
|
243 |
+
try:
|
244 |
+
data_dict[AutoEvalColumn.lang.name] = self.lang
|
245 |
+
except KeyError:
|
246 |
+
print(f"Could not find lang")
|
247 |
+
except AttributeError:
|
248 |
+
print(f"AttributeError lang")
|
249 |
+
|
250 |
try:
|
251 |
data_dict[AutoEvalColumn.likes.name] = self.likes
|
252 |
except KeyError:
|