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

This commit is contained in:
whyiug
2024-10-04 22:34:58 +08:00
committed by GitHub
parent 0e36fd4909
commit 3d826d2c52

View File

@ -967,6 +967,9 @@ class Qwen2VLForConditionalGeneration(nn.Module, SupportsMultiModal,
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)}")