@@ -157,13 +157,12 @@ def run(self):
157
157
)
158
158
self .args .weight_format = "int8"
159
159
160
- weight_format = self .args .weight_format or "fp32"
161
-
162
- ov_config = None
163
- if weight_format in {"fp16" , "fp32" }:
164
- ov_config = OVConfig (dtype = weight_format )
160
+ if self .args .weight_format is None :
161
+ ov_config = None
162
+ elif self .args .weight_format in {"fp16" , "fp32" }:
163
+ ov_config = OVConfig (dtype = self .args .weight_format )
165
164
else :
166
- is_int8 = weight_format == "int8"
165
+ is_int8 = self . args . weight_format == "int8"
167
166
168
167
# For int4 quantization if not parameter is provided, then use the default config if exist
169
168
if (
@@ -182,12 +181,12 @@ def run(self):
182
181
"group_size" : - 1 if is_int8 else self .args .group_size ,
183
182
}
184
183
185
- if weight_format in {"int4_sym_g128" , "int4_asym_g128" , "int4_sym_g64" , "int4_asym_g64" }:
184
+ if self . args . weight_format in {"int4_sym_g128" , "int4_asym_g128" , "int4_sym_g64" , "int4_asym_g64" }:
186
185
logger .warning (
187
- f"--weight-format { weight_format } is deprecated, possible choices are fp32, fp16, int8, int4"
186
+ f"--weight-format { self . args . weight_format } is deprecated, possible choices are fp32, fp16, int8, int4"
188
187
)
189
- quantization_config ["sym" ] = "asym" not in weight_format
190
- quantization_config ["group_size" ] = 128 if "128" in weight_format else 64
188
+ quantization_config ["sym" ] = "asym" not in self . args . weight_format
189
+ quantization_config ["group_size" ] = 128 if "128" in self . args . weight_format else 64
191
190
ov_config = OVConfig (quantization_config = quantization_config )
192
191
193
192
# TODO : add input shapes
0 commit comments