Skip to content

Commit 4416ea1

Browse files
chaunceyjiangDarkLight1337
authored andcommitted
[Bugfix][v1] fixed llava-hf/llava-1.5-7b-hf is broken on V1 (vllm-project#14554)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk> Signed-off-by: Louis Ulmer <ulmerlouis@gmail.com>
1 parent 61165a5 commit 4416ea1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

vllm/model_executor/models/llava.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -783,15 +783,19 @@ def get_multimodal_embeddings(self, **kwargs) -> Optional[NestedTensors]:
783783
if image_input is None:
784784
return None
785785
vision_embeddings = self._process_image_input(image_input)
786-
if kwargs.get("v0_path", False):
786+
787+
if kwargs.get("v0_path", False) or \
788+
image_input.get("feat_is_patch") is None or \
789+
image_input.get("embed_is_patch") is None:
790+
# The path is used for pixtral (V0 only) and llava (V0/V1)
787791
return vision_embeddings
788-
else:
789-
nested_emb = [
790-
self._get_mm_embeds(*args) for args in zip(
791-
vision_embeddings, image_input["feat_is_patch"],
792-
image_input["num_crops"], image_input["embed_is_patch"])
793-
]
794-
return flatten_2d_lists(nested_emb)
792+
793+
nested_emb = [
794+
self._get_mm_embeds(*args) for args in zip(
795+
vision_embeddings, image_input["feat_is_patch"],
796+
image_input["num_crops"], image_input["embed_is_patch"])
797+
]
798+
return flatten_2d_lists(nested_emb)
795799

796800
def get_input_embeddings(
797801
self,

0 commit comments

Comments
 (0)