Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Gemma to list of models to show openvino/transformers version warning for #609

Merged
merged 1 commit into from
Mar 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions optimum/exporters/openvino/model_patcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def patch_model_with_bettertransformer(model):
)

if (
getattr(model.config, "model_type") in {"gpt_bigcode", "llama"}
getattr(model.config, "model_type") in {"gpt_bigcode", "llama", "gemma"}
and is_transformers_version(">=", "4.38")
and is_openvino_version("<", "2024.1.0-14612")
):
Expand All @@ -69,10 +69,11 @@ def patch_model_with_bettertransformer(model):
_openvino_version.split("-")[0] if is_openvino_version("<=", "2024.0.0-14509") else _openvino_version
)
log.warn(
COLOR_RED + f"[WARNING] Stateful models are not supported for Llama and GPTBigCode with Transformers "
COLOR_RED
+ f"[WARNING] Stateful models are not supported for Llama, Gemma and GPTBigCode with Transformers "
f"{_transformers_version} and OpenVINO {display_version}. For good performance, consider using a nightly OpenVINO build: "
"https://docs.openvino.ai/2024/get-started/install-openvino.html. For models that do not need transformers "
"4.38+, it is also an option to downgrade transformers: `pip install transformers==4.37.2`" + COLOR_RESET
"https://docs.openvino.ai/2024/get-started/install-openvino.html. For gpt-bigcode and llama models, "
"it is also an option to downgrade transformers: `pip install transformers==4.37.2`" + COLOR_RESET
)

# model already has required SDPA implementation
Expand Down
Loading