From eecf181198d88f8a8834d594cc9cf2e53234becb Mon Sep 17 00:00:00 2001 From: eaidova Date: Mon, 25 Dec 2023 17:25:16 +0400 Subject: [PATCH] do not compress model twise when compress during export --- optimum/intel/openvino/modeling_base.py | 2 +- optimum/intel/openvino/modeling_base_seq2seq.py | 2 +- optimum/intel/openvino/modeling_decoder.py | 2 +- optimum/intel/openvino/modeling_diffusion.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/optimum/intel/openvino/modeling_base.py b/optimum/intel/openvino/modeling_base.py index 54eb2f44db..685518f6a5 100644 --- a/optimum/intel/openvino/modeling_base.py +++ b/optimum/intel/openvino/modeling_base.py @@ -302,7 +302,7 @@ def _from_transformers( ) config.save_pretrained(save_dir_path) - return cls._from_pretrained(model_id=save_dir_path, config=config, load_in_8bit=load_in_8bit, **kwargs) + return cls._from_pretrained(model_id=save_dir_path, config=config, load_in_8bit=False, **kwargs) @classmethod def _to_load( diff --git a/optimum/intel/openvino/modeling_base_seq2seq.py b/optimum/intel/openvino/modeling_base_seq2seq.py index 485db25bc5..599491277c 100644 --- a/optimum/intel/openvino/modeling_base_seq2seq.py +++ b/optimum/intel/openvino/modeling_base_seq2seq.py @@ -270,7 +270,7 @@ def _from_transformers( config.save_pretrained(save_dir_path) return cls._from_pretrained( - model_id=save_dir_path, config=config, use_cache=use_cache, load_in_8bit=load_in_8bit, **kwargs + model_id=save_dir_path, config=config, use_cache=use_cache, load_in_8bit=False, **kwargs ) def _reshape(self, model: openvino.runtime.Model, batch_size: int, sequence_length: int, is_decoder=True): diff --git a/optimum/intel/openvino/modeling_decoder.py b/optimum/intel/openvino/modeling_decoder.py index 73794c8330..05730ee6b3 100644 --- a/optimum/intel/openvino/modeling_decoder.py +++ b/optimum/intel/openvino/modeling_decoder.py @@ -249,7 +249,7 @@ def _from_transformers( config.is_encoder_decoder = False config.save_pretrained(save_dir_path) return cls._from_pretrained( - model_id=save_dir_path, config=config, use_cache=use_cache, load_in_8bit=load_in_8bit, **kwargs + model_id=save_dir_path, config=config, use_cache=use_cache, load_in_8bit=False, **kwargs ) def _reshape( diff --git a/optimum/intel/openvino/modeling_diffusion.py b/optimum/intel/openvino/modeling_diffusion.py index f51b60f63b..12e8fc213c 100644 --- a/optimum/intel/openvino/modeling_diffusion.py +++ b/optimum/intel/openvino/modeling_diffusion.py @@ -325,7 +325,7 @@ def _from_transformers( tokenizer_2=tokenizer_2, scheduler=scheduler, feature_extractor=feature_extractor, - load_in_8bit=load_in_8bit, + load_in_8bit=False, **kwargs, )