Spaces:
Running
Running
add bit width tag
Browse files
app.py
CHANGED
@@ -59,10 +59,10 @@ def quantize_model(
|
|
59 |
return f"### Invalid input 🐞 Please specify a model name, got {model_id}"
|
60 |
|
61 |
try:
|
62 |
-
dtype = dtype.replace("-", "")
|
63 |
model_name = model_id.split("/")[-1]
|
64 |
username = whoami(oauth_token.token)["name"]
|
65 |
-
|
|
|
66 |
new_repo_id = f"{username}/{model_name}-{suffix}"
|
67 |
library_name = TasksManager.infer_library_from_model(model_id, token=oauth_token.token)
|
68 |
|
@@ -95,7 +95,7 @@ def quantize_model(
|
|
95 |
if calibration_dataset == "None":
|
96 |
calibration_dataset = None
|
97 |
|
98 |
-
is_int8 = dtype == "
|
99 |
# if library_name == "diffusers":
|
100 |
# quant_method = "hybrid"
|
101 |
if not is_int8 and calibration_dataset is not None:
|
@@ -170,6 +170,7 @@ def quantize_model(
|
|
170 |
card.data.tags = []
|
171 |
card.data.tags.append("openvino")
|
172 |
card.data.tags.append("nncf")
|
|
|
173 |
card.data.base_model = model_id
|
174 |
|
175 |
card.text = dedent(
|
|
|
59 |
return f"### Invalid input 🐞 Please specify a model name, got {model_id}"
|
60 |
|
61 |
try:
|
|
|
62 |
model_name = model_id.split("/")[-1]
|
63 |
username = whoami(oauth_token.token)["name"]
|
64 |
+
w_t = dtype.replace("-", "")
|
65 |
+
suffix = f"{w_t}" if model_name.endswith("openvino") else f"openvino-{w_t}"
|
66 |
new_repo_id = f"{username}/{model_name}-{suffix}"
|
67 |
library_name = TasksManager.infer_library_from_model(model_id, token=oauth_token.token)
|
68 |
|
|
|
95 |
if calibration_dataset == "None":
|
96 |
calibration_dataset = None
|
97 |
|
98 |
+
is_int8 = dtype == "8-bit"
|
99 |
# if library_name == "diffusers":
|
100 |
# quant_method = "hybrid"
|
101 |
if not is_int8 and calibration_dataset is not None:
|
|
|
170 |
card.data.tags = []
|
171 |
card.data.tags.append("openvino")
|
172 |
card.data.tags.append("nncf")
|
173 |
+
card.data.tags.append(dtype)
|
174 |
card.data.base_model = model_id
|
175 |
|
176 |
card.text = dedent(
|