Skip to content

Commit 5e7b016

Browse files
committed
fix
1 parent 1d795fc commit 5e7b016

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

_unittests/ut_torch_export_patches/test_dynamic_class.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
ignore_warnings,
99
hide_stdout,
1010
requires_torch,
11+
has_transformers,
1112
)
1213
from onnx_diagnostic.helpers import string_type
1314
from onnx_diagnostic.cache_helpers import make_dynamic_cache
@@ -21,7 +22,8 @@ class TestOnnxExportErrors(ExtTestCase):
2122
@ignore_warnings(UserWarning)
2223
@hide_stdout()
2324
def test_export_dynamic_cache_update(self):
24-
for strict in self.subloop([True, False], verbose=1):
25+
values = [True, False] if has_transformers("4.50") else [False]
26+
for strict in self.subloop(values, verbose=1):
2527

2628
class SubModelCache(torch.nn.Module):
2729
def forward(self, cache):

_unittests/ut_torch_models/test_tiny_llms_onnx.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class TestTinyLlmOnnx(ExtTestCase):
2222
@ignore_warnings((UserWarning, DeprecationWarning, FutureWarning))
23-
@requires_transformers("4.50.9999")
23+
@requires_transformers("4.52.9999")
2424
@hide_stdout()
2525
def test_onnx_export_tiny_llm_official(self):
2626
data = get_tiny_llm()
@@ -53,9 +53,10 @@ def test_onnx_export_tiny_llm_xdbg(self):
5353
self.assertEqual(
5454
{"attention_mask", "past_key_values", "input_ids", "position_ids"}, set(inputs)
5555
)
56-
onx = to_onnx(
57-
model, (), kwargs=inputs, dynamic_shapes=data["dynamic_shapes"], verbose=1
58-
)
56+
with bypass_export_some_errors(patch_transformers=True):
57+
onx = to_onnx(
58+
model, (), kwargs=inputs, dynamic_shapes=data["dynamic_shapes"], verbose=1
59+
)
5960
self.assert_onnx_disc(
6061
inspect.currentframe().f_code.co_name, onx, model, inputs, verbose=1
6162
)

onnx_diagnostic/ext_test_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1097,7 +1097,7 @@ def _debug(self):
10971097
return os.environ.get("DEBUG") in BOOLEAN_VALUES
10981098

10991099
def subloop(self, *args, verbose: int = 0):
1100-
"Loops over elements and calls :meth:`unittests.TextCase.subTest`."
1100+
"Loops over elements and calls :meth:`unittests.TestCase.subTest`."
11011101
if len(args) == 1:
11021102
for it in args[0]:
11031103
with self.subTest(case=it):

0 commit comments

Comments
 (0)