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
4 changes: 3 additions & 1 deletion tests/models/minimax_m2/test_modeling_minimax_m2.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,21 +114,22 @@ def test_small_model_logits_batched(self):
EXPECTED_LOGITS_LEFT_UNPADDED = Expectations(
{
("cuda", 8): [[1.1094, -1.5352, -1.5811], [1.9395, 0.1461, -1.5537], [1.7803, 0.2466, -0.4316]],
("xpu", 3): [[1.1094, -1.5342, -1.5831], [1.9414, 0.1533, -1.5566], [1.7793, 0.2546, -0.4331]],
}
)
expected_left_unpadded = torch.tensor(EXPECTED_LOGITS_LEFT_UNPADDED.get_expectation(), device=torch_device)

EXPECTED_LOGITS_RIGHT_UNPADDED = Expectations(
{
("cuda", 8): [[0.8135, -1.8164, -1.5898], [0.0663, -1.3408, -0.5435], [0.5396, 0.3293, -1.7529]],
("xpu", 3): [[0.8140, -1.8174, -1.5898], [0.0706, -1.3359, -0.5435], [0.5464, 0.3320, -1.7539]],
}
)
expected_right_unpadded = torch.tensor(EXPECTED_LOGITS_RIGHT_UNPADDED.get_expectation(), device=torch_device)

with torch.no_grad():
logits = model(dummy_input, attention_mask=attention_mask).logits
logits = logits.float()

torch.testing.assert_close(
logits[0, -3:, -3:],
expected_left_unpadded,
Expand All @@ -146,6 +147,7 @@ def test_small_model_generation(self):
expected_texts = Expectations(
{
("cuda", 8): 'Tell me about the french revolution. Pemkab Pemkab المتاحة/journal blinded blindedébé抓算不上 blinded blinded healthiest.Clébé Bronx开启了 Bronx Bronx抽样ikat糜 BronxSources TODOSources parfum Bronx parfum donde donde donde او',
("xpu", 3): 'Tell me about the french revolution. Pemkab Pemkab المتاحة/journal blinded blindedébé抓算不上 blinded blinded healthiest.Clébé Bronx开启了 Bronx Bronx抽样ikat糜 BronxSources TODOSources parfum Bronx parfum donde donde donde او',
}
) # fmt: skip
EXPECTED_TEXT = expected_texts.get_expectation()
Expand Down