Skip to content

Commit e69eac0

Browse files
committed
fix test
1 parent 75db113 commit e69eac0

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/openvino/test_export.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ def _openvino_export(
8181
model = model_class(f"hf_hub:{model_name}", pretrained=True, exportable=True)
8282
TasksManager.standardize_model_attributes(model_name, model, library_name=library_name)
8383
else:
84-
config = AutoConfig.from_pretrained(model_name)
85-
model_class = TasksManager.get_model_class_for_task(task, model_type=config.model_type.replace("_", "-"))
86-
model = model_class.from_pretrained(model_name, **loading_kwargs)
84+
model = auto_model.auto_model_class.from_pretrained(model_name, **loading_kwargs)
8785

88-
if model.config.model_type == "pix2struct":
86+
if getattr(model.config, "model_type", None) == "pix2struct":
8987
preprocessors = maybe_load_preprocessors(model_name)
9088
else:
9189
preprocessors = None
@@ -110,7 +108,7 @@ def _openvino_export(
110108
self.assertEqual(ov_model.use_cache, use_cache)
111109

112110
if task == "text-generation":
113-
self.assertEqual(ov_model.stateful, stateful)
111+
self.assertEqual(ov_model.stateful, stateful and use_cache)
114112

115113
@parameterized.expand(SUPPORTED_ARCHITECTURES)
116114
def test_export(self, model_type: str):

0 commit comments

Comments
 (0)