128128 NormalizedVisionConfig ,
129129)
130130
131- from ...intel .utils .import_utils import is_diffusers_available , is_diffusers_version , is_transformers_version
131+ from ...intel .utils .import_utils import (
132+ is_diffusers_available ,
133+ is_diffusers_version ,
134+ is_openvino_version ,
135+ is_transformers_version ,
136+ )
132137from .model_patcher import (
133138 AfmoeModelPatcher ,
134139 AquilaModelPatcher ,
232237
233238logger = logging .getLogger (__name__ )
234239
240+
241+ def _warn_potential_accuracy_issue_ov_2026_1 (model_type : str , min_transformers_version : Optional [str ] = None ):
242+ # Fix CVS-185350: OpenVINO 2026.1.0 inference results mismatch
243+ if not is_openvino_version (">=" , "2026.1.0" ):
244+ return
245+ if min_transformers_version is not None and not is_transformers_version (">=" , min_transformers_version ):
246+ return
247+ logger .warning (f"Model type '{ model_type } ' may have potential accuracy issues with OpenVINO >= 2026.1.0." )
248+
249+
235250if TYPE_CHECKING :
236251 from transformers .modeling_utils import PreTrainedModel # noqa: F811
237252
@@ -1258,6 +1273,10 @@ class XGLMConfig(TextDecoderWithPositionIdsOnnxConfig):
12581273 )
12591274 _MODEL_PATCHER = OVDecoderModelPatcher
12601275
1276+ def __init__ (self , * args , ** kwargs ):
1277+ super ().__init__ (* args , ** kwargs )
1278+ _warn_potential_accuracy_issue_ov_2026_1 ("xglm" )
1279+
12611280
12621281class AquilaDummyPastKeyValuesGenerator (DummyPastKeyValuesGenerator ):
12631282 def __init__ (
@@ -1913,6 +1932,7 @@ def patch_model_for_export(self, model: PreTrainedModel, model_kwargs: Optional[
19131932@register_in_tasks_manager ("llava" , * ["image-text-to-text" ], library_name = "transformers" )
19141933class LlavaOpenVINOConfig (BaseVLMOpenVINOConfig ):
19151934 MIN_TRANSFORMERS_VERSION = "4.37.2"
1935+ _OV_2026_1_MODEL_TYPE = "llava"
19161936
19171937 def __init__ (
19181938 self ,
@@ -1935,6 +1955,7 @@ def __init__(
19351955 if self ._behavior == VLMConfigBehavior .VISION_EMBEDDINGS and hasattr (config , "vision_config" ):
19361956 self ._config = config .vision_config
19371957 self ._normalized_config = self .NORMALIZED_CONFIG_CLASS (self ._config )
1958+ _warn_potential_accuracy_issue_ov_2026_1 (self ._OV_2026_1_MODEL_TYPE , min_transformers_version = "5.0" )
19381959
19391960 def patch_model_for_export (self , model : PreTrainedModel , model_kwargs : Optional [Dict [str , Any ]] = None ):
19401961 model_kwargs = model_kwargs or {}
@@ -1951,6 +1972,7 @@ def generate_dummy_inputs(self, framework: str = "pt", **kwargs) -> Dict:
19511972@register_in_tasks_manager ("llava_next" , * ["image-text-to-text" ], library_name = "transformers" )
19521973class LlavaNextOpenVINOConfig (LlavaOpenVINOConfig ):
19531974 MIN_TRANSFORMERS_VERSION = "4.40.0"
1975+ _OV_2026_1_MODEL_TYPE = "llava_next"
19541976
19551977
19561978class DummyLLavaMultiModalProjectorInputGenerator (DummyInputGenerator ):
@@ -2887,6 +2909,7 @@ class MiniCPMVOpenVINOConfig(BaseVLMOpenVINOConfig):
28872909 SUPPORTED_BEHAVIORS = [model_type .value for model_type in MiniCPMVConfigBehavior ]
28882910 NORMALIZED_CONFIG_CLASS = NormalizedVisionConfig
28892911 DUMMY_INPUT_GENERATOR_CLASSES = ()
2912+ MODEL_TYPE = "minicpmv"
28902913
28912914 def __init__ (
28922915 self ,
@@ -2912,6 +2935,7 @@ def __init__(
29122935 if self ._behavior == MiniCPMVConfigBehavior .RESAMPLER :
29132936 self .DUMMY_INPUT_GENERATOR_CLASSES = (DummyMiniCPMVResampleInputGenerator ,)
29142937 self ._normalized_config = self .NORMALIZED_CONFIG_CLASS (self ._config )
2938+ _warn_potential_accuracy_issue_ov_2026_1 (self .MODEL_TYPE )
29152939
29162940 @property
29172941 def inputs (self ) -> Dict [str , Dict [int , str ]]:
@@ -3011,6 +3035,7 @@ def patch_model_for_export(self, model: PreTrainedModel, model_kwargs: Optional[
30113035class MiniCPMOOpenVINOConfig (MiniCPMVOpenVINOConfig ):
30123036 MIN_TRANSFORMERS_VERSION = "4.43.0"
30133037 MAX_TRANSFORMERS_VERSION = "4.51.3"
3038+ MODEL_TYPE = "minicpmo"
30143039
30153040
30163041class Phi3VisionConfigBehavior (str , enum .Enum ):
@@ -4345,6 +4370,10 @@ class BlenderbotSmallOpenVINOConfig(BlenderbotSmallOnnxConfig):
43454370class PegasusOpenVINOConfig (PegasusOnnxConfig ):
43464371 _MODEL_PATCHER = PegasusModelPatcher
43474372
4373+ def __init__ (self , * args , ** kwargs ):
4374+ super ().__init__ (* args , ** kwargs )
4375+ _warn_potential_accuracy_issue_ov_2026_1 ("pegasus" )
4376+
43484377
43494378@register_in_tasks_manager (
43504379 "marian" ,
@@ -4580,6 +4609,10 @@ class Llama4OpenVINOConfig(GotOCR2OpenVINOConfig):
45804609 # TODO (@echarlaix): add v5 support
45814610 MAX_TRANSFORMERS_VERSION = "4.57.6"
45824611
4612+ def __init__ (self , * args , ** kwargs ):
4613+ super ().__init__ (* args , ** kwargs )
4614+ _warn_potential_accuracy_issue_ov_2026_1 ("llama4" )
4615+
45834616 def patch_model_for_export (self , model : PreTrainedModel , model_kwargs : Optional [Dict [str , Any ]] = None ):
45844617 model_kwargs = model_kwargs or {}
45854618 if self ._behavior != VLMConfigBehavior .VISION_EMBEDDINGS :
@@ -4824,6 +4857,10 @@ class Zamba2OpenVINOConfig(MambaOpenVINOConfig):
48244857 # MIN_TRANSFORMERS_VERSION = "5.2.0"
48254858 _MODEL_PATCHER = Zamba2ModelPatcher
48264859
4860+ def __init__ (self , * args , ** kwargs ):
4861+ super ().__init__ (* args , ** kwargs )
4862+ _warn_potential_accuracy_issue_ov_2026_1 ("zamba2" )
4863+
48274864 def add_past_key_values (self , inputs_or_outputs : Dict [str , Dict [int , str ]], direction : str ):
48284865 if direction not in ["inputs" , "outputs" ]:
48294866 raise ValueError (f'direction must either be "inputs" or "outputs", but { direction } was given' )
@@ -4970,6 +5007,10 @@ class GraniteMoeHybridOpenVINOConfig(MambaOpenVINOConfig):
49705007 MIN_TRANSFORMERS_VERSION = "4.53.0"
49715008 _MODEL_PATCHER = GraniteMoeHybridModelPatcher
49725009
5010+ def __init__ (self , * args , ** kwargs ):
5011+ super ().__init__ (* args , ** kwargs )
5012+ _warn_potential_accuracy_issue_ov_2026_1 ("granitemoehybrid" )
5013+
49735014 def add_past_key_values (self , inputs_or_outputs : Dict [str , Dict [int , str ]], direction : str ):
49745015 if direction not in ["inputs" , "outputs" ]:
49755016 raise ValueError (f'direction must either be "inputs" or "outputs", but { direction } was given' )
@@ -5023,6 +5064,10 @@ class AfmoeOpenVINOConfig(LlamaOpenVINOConfig):
50235064 MIN_TRANSFORMERS_VERSION = "4.55.0"
50245065 _MODEL_PATCHER = AfmoeModelPatcher
50255066
5067+ def __init__ (self , * args , ** kwargs ):
5068+ super ().__init__ (* args , ** kwargs )
5069+ _warn_potential_accuracy_issue_ov_2026_1 ("afmoe" )
5070+
50265071
50275072@register_in_tasks_manager ("olmo2" , * COMMON_TEXT_GENERATION_TASKS , library_name = "transformers" )
50285073class Olmo2OOpenVINOConfig (Olmo2OnnxConfig ):
@@ -5031,7 +5076,9 @@ class Olmo2OOpenVINOConfig(Olmo2OnnxConfig):
50315076
50325077@register_in_tasks_manager ("opt" , * [* COMMON_TEXT_GENERATION_TASKS , "text-classification" , "question-answering" ])
50335078class OPTOpenVINOConfig (OPTOnnxConfig ):
5034- pass
5079+ def __init__ (self , * args , ** kwargs ):
5080+ super ().__init__ (* args , ** kwargs )
5081+ _warn_potential_accuracy_issue_ov_2026_1 ("opt" )
50355082
50365083
50375084@register_in_tasks_manager (
0 commit comments