Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions optimum/exporters/openvino/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ def export(
if max_version is not None:
if isinstance(max_version, Version):
max_version = max_version.base_version
if is_transformers_version(">=", max_version):
if is_transformers_version(">", max_version):
raise ValueError(
f"The current version of Transformers does not allow for the export of the model. Maximum required is "
f"{config.MAX_TRANSFORMERS_VERSION}, got: {_transformers_version}"
f"{config.MAX_TRANSFORMERS_VERSION.replace('99', '*')}, got: {_transformers_version}"
)

if stateful:
Expand Down
16 changes: 8 additions & 8 deletions optimum/exporters/openvino/model_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ class Qwen3MoEOpenVINOConfig(Qwen3OpenVINOConfig):
@register_in_tasks_manager("minicpm", *["text-generation", "text-generation-with-past"], library_name="transformers")
class MiniCPMOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
DEFAULT_ONNX_OPSET = 14
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"
DUMMY_INPUT_GENERATOR_CLASSES = (DummyTextInputGenerator, MistralDummyPastKeyValuesGenerator)
DUMMY_PKV_GENERATOR_CLASS = MistralDummyPastKeyValuesGenerator
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
Expand Down Expand Up @@ -368,7 +368,7 @@ def generate(self, input_name: str, framework: str = "pt", int_dtype: str = "int
@register_in_tasks_manager("minicpm3", *["text-generation", "text-generation-with-past"], library_name="transformers")
class MiniCPM3OpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):
DEFAULT_ONNX_OPSET = 14
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"
DUMMY_INPUT_GENERATOR_CLASSES = (DummyTextInputGenerator, OVMiniCPM3DummyPastKeyValuesGenerator)
DUMMY_PKV_GENERATOR_CLASS = OVMiniCPM3DummyPastKeyValuesGenerator
NORMALIZED_CONFIG_CLASS = NormalizedTextConfig
Expand Down Expand Up @@ -1066,7 +1066,7 @@ class JaisOpenVINOConfig(TextDecoderWithPositionIdsOnnxConfig):

@register_in_tasks_manager("arctic", *["text-generation", "text-generation-with-past"], library_name="transformers")
class ArcticOpenVINOConfig(MixtralOpenVINOConfig):
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"
_MODEL_PATCHER = ArcticModelPatcher


Expand Down Expand Up @@ -1876,7 +1876,7 @@ def patch_model_for_export(self, model: PreTrainedModel, model_kwargs: Optional[
class LlavaQwen2OpenVINOConfig(BaseVLMOpenVINOConfig):
SUPPORTS_PAST = True
MIN_TRANSFORMERS_VERSION = "4.40.0"
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"

def __init__(
self,
Expand Down Expand Up @@ -2685,7 +2685,7 @@ def patch_model_for_export(self, model: PreTrainedModel, model_kwargs: Optional[
@register_in_tasks_manager("minicpmo", *["image-text-to-text"], library_name="transformers")
class MiniCPMOOpenVINOConfig(MiniCPMVOpenVINOConfig):
MIN_TRANSFORMERS_VERSION = "4.43.0"
MAX_TRANSFORMERS_VERSION = "4.51.99"
MAX_TRANSFORMERS_VERSION = "4.51.3"


class Phi3VisionConfigBehavior(str, enum.Enum):
Expand Down Expand Up @@ -2750,7 +2750,7 @@ class Phi3VisionOpenVINOConfig(BaseVLMOpenVINOConfig):
NORMALIZED_CONFIG_CLASS = NormalizedVisionConfig
DUMMY_INPUT_GENERATOR_CLASSES = (DummyVisionInputGenerator,)
MIN_TRANSFORMERS_VERSION = "4.40.0"
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"

def __init__(
self,
Expand Down Expand Up @@ -2998,7 +2998,7 @@ class Phi4MMOpenVINOConfig(BaseVLMOpenVINOConfig):
NORMALIZED_CONFIG_CLASS = NormalizedVisionConfig
DUMMY_INPUT_GENERATOR_CLASSES = (DummyVisionInputGenerator,)
MIN_TRANSFORMERS_VERSION = "4.51.0"
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"

def __init__(
self,
Expand Down Expand Up @@ -3667,7 +3667,7 @@ class M2M100OpenVINOConfig(BartOpenVINOConfig):
)
@register_in_tasks_manager("deepseek", *["text-generation", "text-generation-with-past"], library_name="transformers")
class DeepseekOpenVINOConfig(MiniCPM3OpenVINOConfig):
MAX_TRANSFORMERS_VERSION = "4.54.0"
MAX_TRANSFORMERS_VERSION = "4.53.3"
_MODEL_PATCHER = DeepseekPatcher


Expand Down
2 changes: 1 addition & 1 deletion tests/openvino/utils_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def get_supported_model_for_library(library_name):
min_transformers = str(getattr(export_config.func, "MIN_TRANSFORMERS_VERSION", "0"))
max_transformers = str(getattr(export_config.func, "MAX_TRANSFORMERS_VERSION", "999"))

if is_transformers_version(">=", min_transformers) and is_transformers_version("<", max_transformers):
if is_transformers_version(">=", min_transformers) and is_transformers_version("<=", max_transformers):
valid_model.add(model_type)

return valid_model
Loading