diff --git a/tests/test_utils.py b/tests/test_utils.py index 58514739fea..fae5dbaefda 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -2072,7 +2072,8 @@ def _setup_vlm(self, model_id): add_fused_lm_head(chunked_model) B, S = 2, 16 - vocab_size = ref_model.config.text_config.vocab_size + # Inkling 2's head outputs unpadded_vocab_size < vocab_size logits (#8590) + vocab_size = ref_model.get_output_embeddings().out_features input_ids = torch.randint(0, vocab_size, (B, S), device=torch_device) labels = input_ids.clone() labels[:, :4] = -100