danielz02
commited on
Add quantized model precision
Browse files- src/display/utils.py +20 -9
src/display/utils.py
CHANGED
@@ -99,9 +99,14 @@ class WeightType(Enum):
|
|
99 |
class Precision(Enum):
|
100 |
float16 = ModelDetails("float16")
|
101 |
bfloat16 = ModelDetails("bfloat16")
|
102 |
-
|
103 |
-
|
104 |
-
|
|
|
|
|
|
|
|
|
|
|
105 |
Unknown = ModelDetails("?")
|
106 |
|
107 |
def from_str(precision):
|
@@ -109,12 +114,18 @@ class Precision(Enum):
|
|
109 |
return Precision.float16
|
110 |
if precision in ["torch.bfloat16", "bfloat16"]:
|
111 |
return Precision.bfloat16
|
112 |
-
if precision in ["
|
113 |
-
return Precision.
|
114 |
-
if precision in ["4bit"]:
|
115 |
-
return Precision.
|
116 |
-
if precision in ["
|
117 |
-
return Precision.
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
return Precision.Unknown
|
119 |
|
120 |
|
|
|
99 |
class Precision(Enum):
|
100 |
float16 = ModelDetails("float16")
|
101 |
bfloat16 = ModelDetails("bfloat16")
|
102 |
+
|
103 |
+
qt_gptq_3bit = ModelDetails("GPTQ-3bit")
|
104 |
+
qt_gptq_4bit = ModelDetails("GPTQ-4bit")
|
105 |
+
qt_gptq_8bit = ModelDetails("GPTQ-8bit")
|
106 |
+
qt_awq_3bit = ModelDetails("AWQ-3bit")
|
107 |
+
qt_awq_4bit = ModelDetails("AWQ-4bit")
|
108 |
+
qt_awq_8bit = ModelDetails("AWQ-8bit")
|
109 |
+
|
110 |
Unknown = ModelDetails("?")
|
111 |
|
112 |
def from_str(precision):
|
|
|
114 |
return Precision.float16
|
115 |
if precision in ["torch.bfloat16", "bfloat16"]:
|
116 |
return Precision.bfloat16
|
117 |
+
if precision in ["gptq-3bit"]:
|
118 |
+
return Precision.qt_gptq_3bit
|
119 |
+
if precision in ["gptq-4bit"]:
|
120 |
+
return Precision.qt_gptq_4bit
|
121 |
+
if precision in ["gptq-8bit"]:
|
122 |
+
return Precision.qt_gptq_8bit
|
123 |
+
if precision in ["awq-3bit"]:
|
124 |
+
return Precision.qt_awq_3bit
|
125 |
+
if precision in ["awq-4bit"]:
|
126 |
+
return Precision.qt_awq_4bit
|
127 |
+
if precision in ["awq-8bit"]:
|
128 |
+
return Precision.qt_awq_8bit
|
129 |
return Precision.Unknown
|
130 |
|
131 |
|