mirror of
https://git.datalinker.icu/vllm-project/vllm.git
synced 2026-07-09 11:17:14 +08:00
[V1][VLM] Fix edge case bug for InternVL2 (#11165)
Signed-off-by: Roger Wang <ywang@roblox.com>
This commit is contained in:
parent
eeec9e3390
commit
969da7d70b
@ -669,8 +669,11 @@ class InternVLChatModel(nn.Module, SupportsMultiModal, SupportsPP):
|
|||||||
image_embeds = self.extract_feature(image_input["data"])
|
image_embeds = self.extract_feature(image_input["data"])
|
||||||
|
|
||||||
patches_per_image = image_input["patches_per_image"]
|
patches_per_image = image_input["patches_per_image"]
|
||||||
|
|
||||||
|
# Only one image in the current batch
|
||||||
if len(patches_per_image) == 1:
|
if len(patches_per_image) == 1:
|
||||||
image_embeds = image_embeds.unsqueeze(0)
|
image_embeds = image_embeds.view(
|
||||||
|
-1, self.config.text_config.hidden_size).unsqueeze(0)
|
||||||
return image_embeds
|
return image_embeds
|
||||||
|
|
||||||
# NOTE: Image embeddings are split into separate tensors for each image
|
# NOTE: Image embeddings are split into separate tensors for each image
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user