|
31 | 31 | from optimum.exporters.onnx.constants import SDPA_ARCHS_ONNX_EXPORT_NOT_SUPPORTED
|
32 | 32 | from optimum.exporters.openvino.convert import export_from_model
|
33 | 33 | from optimum.intel.utils.import_utils import (
|
| 34 | + is_nncf_available, |
34 | 35 | is_openvino_tokenizers_available,
|
35 | 36 | is_openvino_version,
|
36 |
| - is_transformers_version, is_nncf_available, |
| 37 | + is_transformers_version, |
37 | 38 | )
|
38 | 39 | from optimum.utils.save_utils import maybe_load_preprocessors
|
39 | 40 |
|
40 |
| -from .utils import clear_class_registry, _MAX_UNCOMPRESSED_SIZE |
| 41 | +from .utils import _MAX_UNCOMPRESSED_SIZE, clear_class_registry |
| 42 | + |
41 | 43 |
|
42 | 44 | if TYPE_CHECKING:
|
43 | 45 | from optimum.intel.openvino.configuration import OVConfig
|
@@ -449,15 +451,13 @@ class StoreAttr(object):
|
449 | 451 | continue
|
450 | 452 |
|
451 | 453 | 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`") |
455 | 455 |
|
456 | 456 | from optimum.intel.openvino.quantization import _weight_only_quantization
|
457 | 457 |
|
458 | 458 | _weight_only_quantization(submodel, quantization_config)
|
459 | 459 |
|
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" |
461 | 461 | save_model(submodel, compressed_submodel_path, compress_to_fp16=ov_config and ov_config.dtype == "fp16")
|
462 | 462 | compressed_submodel_paths.append((submodel_path, compressed_submodel_path))
|
463 | 463 |
|
|
0 commit comments