Skip to content

Commit

Permalink
Set auto dtype during model export
Browse files Browse the repository at this point in the history
  • Loading branch information
nikita-savelyevv committed Dec 12, 2024
1 parent 35cf1d2 commit b547418
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 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 @@ -592,7 +592,7 @@ def _from_transformers(
if load_in_8bit is None and not quantization_config:
ov_config = None
else:
ov_config = OVConfig(dtype="fp32")
ov_config = OVConfig(dtype="auto")

main_export(
model_name_or_path=model_id,
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 @@ -364,7 +364,7 @@ def _from_transformers(
if load_in_8bit is None and not quantization_config:
ov_config = None
else:
ov_config = OVConfig(dtype="fp32")
ov_config = OVConfig(dtype="auto")

main_export(
model_name_or_path=model_id,
Expand Down
4 changes: 2 additions & 2 deletions optimum/intel/openvino/modeling_open_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def _from_transformers(
if load_in_8bit is None and not quantization_config:
ov_config = None
else:
ov_config = OVConfig(dtype="fp32")
ov_config = OVConfig(dtype="auto")

def fn_get_submodels(model):
return {"model_text": model.text}
Expand Down Expand Up @@ -372,7 +372,7 @@ def _from_transformers(
if load_in_8bit is None and not quantization_config:
ov_config = None
else:
ov_config = OVConfig(dtype="fp32")
ov_config = OVConfig(dtype="auto")

def fn_get_submodels(model):
return {"model_vision": model.visual}
Expand Down
2 changes: 1 addition & 1 deletion optimum/intel/openvino/modeling_visual_language.py
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ def _from_transformers(
if load_in_8bit is None and not quantization_config:
ov_config = None
else:
ov_config = OVConfig(dtype="fp32")
ov_config = OVConfig(dtype="auto")

stateful = kwargs.pop("stateful", ensure_stateful_is_available(warn=False) and use_cache)

Expand Down

0 comments on commit b547418

Please sign in to comment.