Skip to content

Commit 73fbc9c

Browse files
Isotr0pytjtanaa
authored andcommitted
[Bugfix] Fix broken internvl2 inference with v1 (vllm-project#12360)
Signed-off-by: Isotr0py <2037008807@qq.com>
1 parent a62058d commit 73fbc9c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

vllm/multimodal/utils.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,8 +503,13 @@ def modality_group_func(mm_input: "MultiModalKwargs") -> Union[str, int]:
503503
if len(mm_input.modalities) > 1:
504504
return id(mm_input)
505505

506-
# Otherwise return the modality string
507-
return list(mm_input.modalities)[0]
506+
elif len(mm_input.modalities) == 1:
507+
return list(mm_input.modalities)[0]
508+
509+
# FIXME(Isotr0py): Modality of mm_input from legacy pipeline is empty,
510+
# this is used to make InternVL with legacy pipeline still work with v1.
511+
else:
512+
return ""
508513

509514
return [
510515
list(group) for _, group in groupby(mm_inputs, key=modality_group_func)

0 commit comments

Comments
 (0)