Skip to content

Commit

Permalink
[V1][VLM] Fix edge case bug for InternVL2 (vllm-project#11165)
Browse files Browse the repository at this point in the history
Signed-off-by: Roger Wang <[email protected]>
  • Loading branch information
ywang96 authored Dec 13, 2024
1 parent eeec9e3 commit 969da7d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion vllm/model_executor/models/internvl.py
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,11 @@ def _process_image_input(
image_embeds = self.extract_feature(image_input["data"])

patches_per_image = image_input["patches_per_image"]

# Only one image in the current batch
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

# NOTE: Image embeddings are split into separate tensors for each image
Expand Down

0 comments on commit 969da7d

Please sign in to comment.