Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
3a3b06ee
Unverified
Commit
3a3b06ee
authored
Dec 11, 2025
by
Cyrus Leung
Committed by
GitHub
Dec 11, 2025
Browse files
[Misc] Improve error message for `is_multimodal` (#30483)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
f4417f84
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
7 deletions
+21
-7
vllm/model_executor/models/interfaces.py
vllm/model_executor/models/interfaces.py
+17
-3
vllm/model_executor/models/phi3v.py
vllm/model_executor/models/phi3v.py
+2
-3
vllm/model_executor/models/qwen3_vl.py
vllm/model_executor/models/qwen3_vl.py
+2
-1
No files found.
vllm/model_executor/models/interfaces.py
View file @
3a3b06ee
...
...
@@ -53,6 +53,22 @@ The output embeddings must be one of the following formats:
"""
def
_require_is_multimodal
(
is_multimodal
:
Tensor
|
None
)
->
Tensor
:
"""
A helper function to be used in the context of
[vllm.model_executor.models.interfaces.SupportsMultiModal.embed_input_ids][]
to provide a better error message.
"""
if
is_multimodal
is
None
:
raise
ValueError
(
"`embed_input_ids` now requires `is_multimodal` arg, "
"please update your model runner according to "
"https://github.com/vllm-project/vllm/pull/16229."
)
return
is_multimodal
@
runtime_checkable
class
SupportsMultiModal
(
Protocol
):
"""The interface required for all multi-modal models."""
...
...
@@ -190,12 +206,10 @@ class SupportsMultiModal(Protocol):
if
multimodal_embeddings
is
None
or
len
(
multimodal_embeddings
)
==
0
:
return
inputs_embeds
assert
is_multimodal
is
not
None
return
_merge_multimodal_embeddings
(
inputs_embeds
=
inputs_embeds
,
multimodal_embeddings
=
multimodal_embeddings
,
is_multimodal
=
is_multimodal
,
is_multimodal
=
_require_
is_multimodal
(
is_multimodal
)
,
)
...
...
vllm/model_executor/models/phi3v.py
View file @
3a3b06ee
...
...
@@ -64,6 +64,7 @@ from .interfaces import (
SupportsMultiModal
,
SupportsPP
,
SupportsQuant
,
_require_is_multimodal
,
)
from
.utils
import
(
AutoWeightsLoader
,
...
...
@@ -687,12 +688,10 @@ class Phi3VForCausalLM(nn.Module, SupportsMultiModal, SupportsPP, SupportsQuant)
if
multimodal_embeddings
is
None
or
len
(
multimodal_embeddings
)
==
0
:
return
inputs_embeds
assert
is_multimodal
is
not
None
return
_merge_multimodal_embeddings
(
inputs_embeds
=
inputs_embeds
,
multimodal_embeddings
=
multimodal_embeddings
,
is_multimodal
=
is_multimodal
,
is_multimodal
=
_require_
is_multimodal
(
is_multimodal
)
,
)
def
forward
(
...
...
vllm/model_executor/models/qwen3_vl.py
View file @
3a3b06ee
...
...
@@ -93,6 +93,7 @@ from .interfaces import (
SupportsMRoPE
,
SupportsMultiModal
,
SupportsPP
,
_require_is_multimodal
,
)
from
.qwen2_5_vl
import
(
Qwen2_5_VisionAttention
,
...
...
@@ -1572,7 +1573,7 @@ class Qwen3VLForConditionalGeneration(
if
multimodal_embeddings
is
None
or
len
(
multimodal_embeddings
)
==
0
:
return
inputs_embeds
assert
is_multimodal
is
not
None
is_multimodal
=
_require_
is_multimodal
(
is
_multimodal
)
if
self
.
use_deepstack
:
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment