Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tests/models/mistral3/test_modeling_mistral3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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 = [
[
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading