Skip to content

Commit

Permalink
do not compress model twise when compress during export
Browse files Browse the repository at this point in the history
  • Loading branch information
eaidova committed Dec 25, 2023
1 parent 3bc3d01 commit eecf181
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_base_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_diffusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)

Expand Down

0 comments on commit eecf181

Please sign in to comment.