Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix tests
Signed-off-by: Sukriti-Sharma4 <sukriti.sharma4@ibm.com>
  • Loading branch information
Ssukriti committed Mar 20, 2025
commit aef4f51596a1511e0ab0803086189e2b1a04b1e1
4 changes: 4 additions & 0 deletions tests/models/mllama/test_modeling_mllama.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,9 @@ def test_inputs_embeds_matches_input_ids(self):
def test_resize_embeddings_results_in_successful_loss(self):
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test for reported bug that would fail earlier and now pass

# resizing embeddings should result in successful loss computation
config, inputs = self.model_tester.prepare_config_and_inputs_for_common()
labels = torch.zeros(
(self.batch_size, self.seq_length), dtype=torch.long, device=torch_device
)

for model_class in self.all_model_classes:
model = model_class(config)
Expand All @@ -334,6 +337,7 @@ def test_resize_embeddings_results_in_successful_loss(self):
loss = model(
input_ids=inputs["input_ids"],
attention_mask=inputs["attention_mask"],
labels=labels,
return_dict=True,
)["loss"]
self.parent.assertFalse(torch.isnan(loss).any().item())
Expand Down