Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
t0-0
commited on
Commit
·
87ab411
1
Parent(s):
99af895
Remove unused code
Browse files- src/display/utils.py +4 -11
src/display/utils.py
CHANGED
@@ -136,13 +136,13 @@ class Precision(Enum):
|
|
136 |
|
137 |
@staticmethod
|
138 |
def from_str(precision: str) -> "Precision":
|
139 |
-
if precision
|
140 |
return Precision.auto
|
141 |
-
if precision
|
142 |
return Precision.float16
|
143 |
-
if precision
|
144 |
return Precision.bfloat16
|
145 |
-
if precision
|
146 |
return Precision.float32
|
147 |
raise ValueError(
|
148 |
f"Unsupported precision type: {precision}. Please use 'auto' (recommended), 'float32', 'float16', or 'bfloat16'"
|
@@ -158,13 +158,6 @@ class NumFewShots(Enum):
|
|
158 |
shots_0 = 0
|
159 |
shots_4 = 4
|
160 |
|
161 |
-
@staticmethod
|
162 |
-
def from_int(shots: int) -> "NumFewShots":
|
163 |
-
try:
|
164 |
-
return NumFewShots(shots)
|
165 |
-
except ValueError:
|
166 |
-
raise ValueError(f"Unsupported few-shot value: {shots}. Must be 0 or 4.")
|
167 |
-
|
168 |
|
169 |
class LLMJpEvalVersion(Enum):
|
170 |
current = ModelDetails("v1.4.1")
|
|
|
136 |
|
137 |
@staticmethod
|
138 |
def from_str(precision: str) -> "Precision":
|
139 |
+
if precision == "auto":
|
140 |
return Precision.auto
|
141 |
+
if precision == "float16":
|
142 |
return Precision.float16
|
143 |
+
if precision == "bfloat16":
|
144 |
return Precision.bfloat16
|
145 |
+
if precision == "float32":
|
146 |
return Precision.float32
|
147 |
raise ValueError(
|
148 |
f"Unsupported precision type: {precision}. Please use 'auto' (recommended), 'float32', 'float16', or 'bfloat16'"
|
|
|
158 |
shots_0 = 0
|
159 |
shots_4 = 4
|
160 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
161 |
|
162 |
class LLMJpEvalVersion(Enum):
|
163 |
current = ModelDetails("v1.4.1")
|