diff --git a/optimum/intel/openvino/modeling.py b/optimum/intel/openvino/modeling.py index 6d0af462cc..f6d3061a7a 100644 --- a/optimum/intel/openvino/modeling.py +++ b/optimum/intel/openvino/modeling.py @@ -554,7 +554,7 @@ def from_pretrained( model = TimmForImageClassification.from_pretrained(model_id, **kwargs) onnx_config = TimmOnnxConfig(model.config) - return cls._to_load(model=model, config=config, onnx_config=onnx_config, stateful=False) + return cls._to_load(model=model, config=config, onnx_config=onnx_config, stateful=False, **kwargs) else: return super().from_pretrained( model_id=model_id, diff --git a/tests/openvino/test_modeling.py b/tests/openvino/test_modeling.py index f26bb92fb8..e51b50a5b2 100644 --- a/tests/openvino/test_modeling.py +++ b/tests/openvino/test_modeling.py @@ -748,6 +748,7 @@ def test_pipeline(self, model_arch): @parameterized.expand(TIMM_MODELS) def test_compare_to_timm(self, model_id): ov_model = OVModelForImageClassification.from_pretrained(model_id, export=True, ov_config=F32_CONFIG) + self.assertEqual(ov_model.request.get_property("INFERENCE_PRECISION_HINT").to_string(), "f32") self.assertIsInstance(ov_model.config, PretrainedConfig) timm_model = timm.create_model(model_id, pretrained=True) preprocessor = TimmImageProcessor.from_pretrained(model_id)