Behnamm commited on
Commit
53b88a8
β€’
1 Parent(s): 47730ef

Update src/display/utils.py

Browse files
Files changed (1) hide show
  1. 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
- FT = ModelDetails(name="fine-tuned", symbol="πŸ”Ά")
67
- IFT = ModelDetails(name="instruction-tuned", symbol="β­•")
68
- RL = ModelDetails(name="RL-tuned", symbol="🟦")
69
- Unknown = ModelDetails(name="", symbol="?")
 
 
70
 
71
  def to_str(self, separator=" "):
72
  return f"{self.value.symbol}{separator}{self.value.name}"
73
 
74
  @staticmethod
75
- def from_str(type):
76
- if "fine-tuned" in type or "πŸ”Ά" in type:
77
  return ModelType.FT
78
- if "pretrained" in type or "🟒" in type:
 
 
79
  return ModelType.PT
80
- if "RL-tuned" in type or "🟦" in type:
81
- return ModelType.RL
82
- if "instruction-tuned" in type or "β­•" in type:
83
- return ModelType.IFT
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):