Skip to content

Commit c944df5

Browse files
committed
patches
1 parent b407e8d commit c944df5

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

_unittests/ut_tasks/test_tasks_image_text_to_text.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,23 @@
66
requires_transformers,
77
requires_torch,
88
)
9+
from onnx_diagnostic.helpers.torch_helper import torch_deepcopy
910
from onnx_diagnostic.torch_models.hghub.model_inputs import get_untrained_model_with_inputs
1011
from onnx_diagnostic.torch_export_patches import torch_export_patches
1112
from onnx_diagnostic.torch_export_patches.patch_inputs import use_dyn_not_str
1213

1314

1415
class TestTasksImageTextToText(ExtTestCase):
1516
@hide_stdout()
16-
@requires_transformers("4.52")
17+
@requires_transformers("4.53")
1718
@requires_torch("2.7.99")
1819
def test_image_text_to_text(self):
1920
mid = "HuggingFaceM4/tiny-random-idefics"
2021
data = get_untrained_model_with_inputs(mid, verbose=1, add_second_input=True)
2122
self.assertEqual(data["task"], "image-text-to-text")
2223
self.assertIn((data["size"], data["n_weights"]), [(12742888, 3185722)])
2324
model, inputs, ds = data["model"], data["inputs"], data["dynamic_shapes"]
24-
model(**inputs)
25+
model(**torch_deepcopy(inputs))
2526
model(**data["inputs2"])
2627
with torch_export_patches(patch_transformers=True, verbose=10):
2728
torch.export.export(

_unittests/ut_torch_models/test_validate_whole_models.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ def test_validate_model_vit_model(self):
258258
@requires_torch("2.7")
259259
@hide_stdout()
260260
@ignore_warnings(FutureWarning)
261-
@requires_transformers("4.53")
261+
@requires_transformers("4.52")
262262
def test_validate_phi35_mini_instruct(self):
263263
mid = "microsoft/Phi-3.5-mini-instruct"
264264
summary, data = validate_model(

onnx_diagnostic/torch_export_patches/patches/patch_transformers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,4 +1180,4 @@ def forward(
11801180
if output_attentions:
11811181
attn_weights = None
11821182

1183-
return attn_output, attn_weights, past_key_value
1183+
return attn_output, attn_weights

0 commit comments

Comments
 (0)