Skip to content

Commit

Permalink
[Bugfix] Fix broken internvl2 inference with v1 (vllm-project#12360)
Browse files Browse the repository at this point in the history
Signed-off-by: Isotr0py <2037008807@qq.com>
  • Loading branch information
Isotr0py authored and panf2333 committed Feb 18, 2025
1 parent 8b9974a commit e752b0c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions vllm/multimodal/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,13 @@ def modality_group_func(mm_input: "MultiModalKwargs") -> Union[str, int]:
if len(mm_input.modalities) > 1:
return id(mm_input)

# Otherwise return the modality string
return list(mm_input.modalities)[0]
elif len(mm_input.modalities) == 1:
return list(mm_input.modalities)[0]

# FIXME(Isotr0py): Modality of mm_input from legacy pipeline is empty,
# this is used to make InternVL with legacy pipeline still work with v1.
else:
return ""

return [
list(group) for _, group in groupby(mm_inputs, key=modality_group_func)
Expand Down

0 comments on commit e752b0c

Please sign in to comment.