Skip to content

Commit 7789c55

Browse files
Style
1 parent 3ffacd3 commit 7789c55

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

optimum/exporters/openvino/__main__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
from optimum.exporters.onnx.constants import SDPA_ARCHS_ONNX_EXPORT_NOT_SUPPORTED
3232
from optimum.exporters.openvino.convert import export_from_model
3333
from optimum.intel.utils.import_utils import (
34+
is_nncf_available,
3435
is_openvino_tokenizers_available,
3536
is_openvino_version,
36-
is_transformers_version, is_nncf_available,
37+
is_transformers_version,
3738
)
3839
from optimum.utils.save_utils import maybe_load_preprocessors
3940

40-
from .utils import clear_class_registry, _MAX_UNCOMPRESSED_SIZE
41+
from .utils import _MAX_UNCOMPRESSED_SIZE, clear_class_registry
42+
4143

4244
if TYPE_CHECKING:
4345
from optimum.intel.openvino.configuration import OVConfig
@@ -449,15 +451,13 @@ class StoreAttr(object):
449451
continue
450452

451453
if not is_nncf_available():
452-
raise ImportError(
453-
"Quantization of the weights requires nncf, please install it with `pip install nncf`"
454-
)
454+
raise ImportError("Quantization of the weights requires nncf, please install it with `pip install nncf`")
455455

456456
from optimum.intel.openvino.quantization import _weight_only_quantization
457457

458458
_weight_only_quantization(submodel, quantization_config)
459459

460-
compressed_submodel_path = Path(str(submodel_path).replace(".xml", "_compressed.xml"))
460+
compressed_submodel_path = submodel_path.parent / f"{submodel_path.stem}_compressed.xml"
461461
save_model(submodel, compressed_submodel_path, compress_to_fp16=ov_config and ov_config.dtype == "fp16")
462462
compressed_submodel_paths.append((submodel_path, compressed_submodel_path))
463463

0 commit comments

Comments
 (0)