diff --git a/tests/models/mistral3/test_modeling_mistral3.py b/tests/models/mistral3/test_modeling_mistral3.py index 457dc6b8ea8b..b75a5a2439ec 100644 --- a/tests/models/mistral3/test_modeling_mistral3.py +++ b/tests/models/mistral3/test_modeling_mistral3.py @@ -300,7 +300,7 @@ def test_mistral3_integration_generate(self): expected_outputs = Expectations( { ("xpu", 3): "The image features two tabby cats lying on a pink surface, which appears to be a cushion or", - ("cuda", 8): 'The image features two cats lying on a pink surface, which appears to be a couch or a bed', + ("cuda", 8): 'The image features two tabby cats lying on a pink surface, which appears to be a couch or', ("rocm", (9, 4)): "The image features two cats lying on a pink surface, which appears to be a couch or a bed", ("rocm", (9, 5)): "The image features two tabby cats lying on a pink surface, which appears to be a cushion or" } @@ -311,6 +311,7 @@ def test_mistral3_integration_generate(self): @require_deterministic_for_xpu def test_mistral3_integration_batched_generate(self): processor = AutoProcessor.from_pretrained(self.model_checkpoint) + processor.tokenizer.padding_side = "left" processor.chat_template = processor.chat_template.replace('strftime_now("%Y-%m-%d")', '"2025-06-20"') messages = [ [ @@ -354,7 +355,7 @@ def test_mistral3_integration_batched_generate(self): { ("xpu", 3): "Calm lake's mirror gleams,\nWhispering pines stand in silence,\nPath to peace begins.", ("cuda", (8, 0)): "Wooden path to calm,\nReflections whisper secrets,\nNature's peace unfolds.", - ("cuda", (8, 6)): "Calm waters reflect\nWooden path to distant shore\nSilence in the woods", + ("cuda", (8, 6)): "Calm waters reflect\nWooden path to distant shore\nSilence in the scene", ("rocm", (9, 5)): "Calm waters reflect\nWooden path to distant shore\nSilence in the scene" } ) # fmt: skip @@ -383,6 +384,7 @@ def test_mistral3_integration_batched_generate(self): @require_deterministic_for_xpu def test_mistral3_integration_batched_generate_multi_image(self): processor = AutoProcessor.from_pretrained(self.model_checkpoint) + processor.tokenizer.padding_side = "left" processor.chat_template = processor.chat_template.replace('strftime_now("%Y-%m-%d")', '"2025-06-20"') # Prepare inputs @@ -430,7 +432,7 @@ def test_mistral3_integration_batched_generate_multi_image(self): decoded_output = processor.decode(gen_tokens[0], skip_special_tokens=True) expected_outputs = Expectations( { - ("cuda", 8): "Calm waters reflect\nWooden path to distant shore\nPeace in nature's hold", + ("cuda", 8): "Calm waters reflect\nWooden path to distant shore\nSilence in the scene", ("rocm", (9, 4)): "Calm waters reflect\nWooden path to distant shore\nSilence in the pines" } ) # fmt: skip