A high-throughput and memory-efficient inference and serving engine for LLMs
Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git
Synced Nov 15, 19:45 UTC
[Bugfix][v1] fixed llava-hf/llava-1.5-7b-hf is broken on V1 (#14554)
Signed-off-by: chaunceyjiang <chaunceyjiang@gmail.com> Signed-off-by: DarkLight1337 <tlleungac@connect.ust.hk> Co-authored-by: DarkLight1337 <tlleungac@connect.ust.hk>
Chauncey committed
Mar 11, 2025 at 02:24 UTC
92b0ce2ac75e251fe683f5b720f07001782054ff
1 file changed
+12
-8
vllm/model_executor/models/llava.py
+12
-8
@@ -783,15 +783,19 @@ class LlavaForConditionalGeneration(nn.Module, SupportsMultiModal, SupportsPP):
783
if image_input is None:
784
return None
785
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)
791
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)
799
800
def get_input_embeddings(
801
self,