Unverified Commit 3d826d2c authored by whyiug's avatar whyiug Committed by GitHub
Browse files

[Bugfix] Reshape the dimensions of the input image embeddings in Qwen2VL (#9071)

parent 0e36fd49
...@@ -967,6 +967,9 @@ class Qwen2VLForConditionalGeneration(nn.Module, SupportsMultiModal, ...@@ -967,6 +967,9 @@ class Qwen2VLForConditionalGeneration(nn.Module, SupportsMultiModal,
image_grid_thw=image_grid_thw) image_grid_thw=image_grid_thw)
if image_embeds is not None: 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): if not isinstance(image_embeds, torch.Tensor):
raise ValueError("Incorrect type of image embeddings. " raise ValueError("Incorrect type of image embeddings. "
f"Got type: {type(image_embeds)}") f"Got type: {type(image_embeds)}")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment