diff --git a/optimum/intel/ipex/modeling_base.py b/optimum/intel/ipex/modeling_base.py index 270a9b32da..02cde6471f 100644 --- a/optimum/intel/ipex/modeling_base.py +++ b/optimum/intel/ipex/modeling_base.py @@ -230,7 +230,6 @@ def _from_pretrained( } task = cls.export_feature - config.torch_dtype = torch_dtype model = TasksManager.get_model_from_task( task, model_id, @@ -240,6 +239,7 @@ def _from_pretrained( _commit_hash=commit_hash, **model_kwargs, ) + config = model.config return cls(model, config=config, export=True, **kwargs) def _save_pretrained(self, save_directory: Union[str, Path]):