fix: Qwen2-VL generate with inputs_embeds (#35466)

* fix: Qwen2-VL generate with inputs_embeds

* change: optional input_ids in get_rope_index
This commit is contained in:
Minho Shim
2025-01-09 00:36:03 +09:00
committed by GitHub
parent 88e18b3c63
commit 4349a0e401
2 changed files with 6 additions and 13 deletions

View File

@@ -1615,9 +1615,7 @@ class GenerationTesterMixin:
# There are a few exception patterns in this test:
# 1 - Some models can't generate without `input_ids`, when `inputs_embeds` are passed
requires_inputs_ids = any(
model_name in model_class.__name__.lower() for model_name in ["idefics", "qwen2vl"]
)
requires_inputs_ids = any(model_name in model_class.__name__.lower() for model_name in ["idefics"])
# 2 - Complex `inputs_embeds` computation, i.e. the correct computation of inputs embeds is more complex
# than calling the embedding layer with `input_ids`. Subcases of this exception:
# 2.A - Ignore `scale_embedding`, if the model supports it (it is controlled by a model-dependent flag)