Skip to content

Commit 704f91a

Browse files
committed
fix
1 parent a297f09 commit 704f91a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

optimum/intel/openvino/quantization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def quantize(
234234
if ov_config is not None:
235235
if not isinstance(ov_config, OVConfig):
236236
raise TypeError(f"`ov_config` should be an `OVConfig`, but got: {type(ov_config)} instead.")
237-
elif not ov_config.compression:
237+
elif ov_config.compression is None:
238238
ov_config.compression = DEFAULT_QUANTIZATION_CONFIG
239239

240240
if isinstance(self.model, OVBaseModel):

optimum/intel/openvino/trainer.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def __init__(
226226
self.compression_controller = None
227227

228228
if self.ov_config is not None:
229-
if not self.ov_config.compression:
229+
if self.ov_config.compression is None:
230230
self.ov_config.compression = DEFAULT_QUANTIZATION_CONFIG
231231

232232
if self.args.do_train:

tests/openvino/test_quantization.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ def test_automodel_weight_compression(self, model_cls, model_name, expected_pt_i
255255
self.assertTrue("logits" in outputs)
256256

257257
# Verify that that the configuration is correctly saved and loaded
258-
openvino_config = OVConfig.from_pretrained(tmp_dir)
258+
loaded_config = OVConfig.from_pretrained(tmp_dir)
259259
self.assertIsNotNone(loaded_config)
260260

261261
@parameterized.expand(SUPPORTED_ARCHITECTURES_WITH_EXPECTED_8BIT_COMPRESSED_MATMULS)

0 commit comments

Comments
 (0)