From e22cd701d7d8bce1d487af6c671acf5142e2bd50 Mon Sep 17 00:00:00 2001 From: whyiug Date: Fri, 4 Oct 2024 22:34:58 +0800 Subject: [PATCH] [Bugfix] Reshape the dimensions of the input image embeddings in Qwen2VL (#9071) Signed-off-by: Amit Garg --- vllm/model_executor/models/qwen2_vl.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vllm/model_executor/models/qwen2_vl.py b/vllm/model_executor/models/qwen2_vl.py index fd8e2436c1e1f..24fd5152ecd09 100644 --- a/vllm/model_executor/models/qwen2_vl.py +++ b/vllm/model_executor/models/qwen2_vl.py @@ -967,6 +967,9 @@ def _parse_and_validate_image_input( image_grid_thw=image_grid_thw) if image_embeds is not None: + image_embeds = self._validate_and_reshape_mm_tensor( + image_embeds, "image embeds") + if not isinstance(image_embeds, torch.Tensor): raise ValueError("Incorrect type of image embeddings. " f"Got type: {type(image_embeds)}")