Update src/display/utils.py
Browse files- src/display/utils.py +16 -12
src/display/utils.py
CHANGED
@@ -62,25 +62,29 @@ class ModelDetails:
|
|
62 |
|
63 |
|
64 |
class ModelType(Enum):
|
65 |
-
PT = ModelDetails(name="pretrained", symbol="π’")
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
|
|
|
|
70 |
|
71 |
def to_str(self, separator=" "):
|
72 |
return f"{self.value.symbol}{separator}{self.value.name}"
|
73 |
|
74 |
@staticmethod
|
75 |
-
def from_str(
|
76 |
-
if
|
77 |
return ModelType.FT
|
78 |
-
if "pretrained" in
|
|
|
|
|
79 |
return ModelType.PT
|
80 |
-
if "RL-tuned"
|
81 |
-
return ModelType.
|
82 |
-
if "
|
83 |
-
return ModelType.
|
84 |
return ModelType.Unknown
|
85 |
|
86 |
class WeightType(Enum):
|
|
|
62 |
|
63 |
|
64 |
class ModelType(Enum):
|
65 |
+
PT = ModelDetails(name="π’ pretrained", symbol="π’")
|
66 |
+
CPT = ModelDetails(name="π© continuously pretrained", symbol="π©")
|
67 |
+
FT = ModelDetails(name="πΆ fine-tuned on domain-specific datasets", symbol="πΆ")
|
68 |
+
chat = ModelDetails(name="π¬ chat models (RLHF, DPO, IFT, ...)", symbol="π¬")
|
69 |
+
merges = ModelDetails(name="π€ base merges and moerges", symbol="π€")
|
70 |
+
Unknown = ModelDetails(name="β other", symbol="β")
|
71 |
+
|
72 |
|
73 |
def to_str(self, separator=" "):
|
74 |
return f"{self.value.symbol}{separator}{self.value.name}"
|
75 |
|
76 |
@staticmethod
|
77 |
+
def from_str(m_type):
|
78 |
+
if any([k for k in m_type if k in ["fine-tuned","πΆ", "finetuned"]]):
|
79 |
return ModelType.FT
|
80 |
+
if "continuously pretrained" in m_type or "π©" in m_type:
|
81 |
+
return ModelType.CPT
|
82 |
+
if "pretrained" in m_type or "π’" in m_type:
|
83 |
return ModelType.PT
|
84 |
+
if any([k in m_type for k in ["instruction-tuned", "RL-tuned", "chat", "π¦", "β", "π¬"]]):
|
85 |
+
return ModelType.chat
|
86 |
+
if "merge" in m_type or "π€" in m_type:
|
87 |
+
return ModelType.merges
|
88 |
return ModelType.Unknown
|
89 |
|
90 |
class WeightType(Enum):
|