Skip to content

Commit 43e26ce

Browse files
committed
fix
1 parent 22f6f47 commit 43e26ce

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

_unittests/ut_tasks/test_tasks_image_classification.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import unittest
22
import torch
3-
from onnx_diagnostic.ext_test_case import ExtTestCase, hide_stdout
3+
from onnx_diagnostic.ext_test_case import ExtTestCase, hide_stdout, has_transformers
44
from onnx_diagnostic.torch_models.hghub.model_inputs import get_untrained_model_with_inputs
55
from onnx_diagnostic.torch_export_patches import bypass_export_some_errors
66
from onnx_diagnostic.torch_export_patches.patch_inputs import use_dyn_not_str
@@ -16,6 +16,8 @@ def test_image_classification(self):
1616
model, inputs, ds = data["model"], data["inputs"], data["dynamic_shapes"]
1717
model(**inputs)
1818
model(**data["inputs2"])
19+
if not has_transformers("4.51.999"):
20+
raise unittest.SkipTest("Requires transformers>=4.52")
1921
with bypass_export_some_errors(patch_transformers=True, verbose=10):
2022
torch.export.export(
2123
model, (), kwargs=inputs, dynamic_shapes=use_dyn_not_str(ds), strict=False

0 commit comments

Comments
 (0)