diff --git a/optimum/intel/neural_compressor/modeling_base.py b/optimum/intel/neural_compressor/modeling_base.py index 0a6521b211..63110bf305 100644 --- a/optimum/intel/neural_compressor/modeling_base.py +++ b/optimum/intel/neural_compressor/modeling_base.py @@ -186,7 +186,7 @@ def _from_pretrained( **kwargs, ) - return model + return cls(model, config=config, model_save_dir=None, **kwargs).model if use_auth_token is not None: warnings.warn( diff --git a/setup.py b/setup.py index 13c1b6796b..d61d5c1858 100644 --- a/setup.py +++ b/setup.py @@ -59,7 +59,7 @@ QUALITY_REQUIRE = ["black~=23.1", "ruff==0.4.4"] EXTRAS_REQUIRE = { - "neural-compressor": ["neural-compressor>3.0", "accelerate", "transformers<4.43"], + "neural-compressor": ["neural-compressor>3.0", "accelerate", "transformers<=4.43.2"], "openvino": ["openvino>=2023.3", "nncf>=2.11.0", "openvino-tokenizers[transformers]"], "nncf": ["nncf>=2.11.0"], "ipex": ["intel-extension-for-pytorch", "transformers>=4.39,<4.45"],