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
13913788
Unverified
Commit
13913788
authored
Feb 19, 2026
by
Cyrus Leung
Committed by
GitHub
Feb 19, 2026
Browse files
[Bugfix] Fix edge case in UUID data parsing (#34884)
Signed-off-by:
DarkLight1337
<
tlleungac@connect.ust.hk
>
parent
f6220f98
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
tests/renderers/test_process_multi_modal_uuids.py
tests/renderers/test_process_multi_modal_uuids.py
+13
-3
vllm/renderers/base.py
vllm/renderers/base.py
+1
-1
No files found.
tests/renderers/test_process_multi_modal_uuids.py
View file @
13913788
...
@@ -42,6 +42,16 @@ def test_multi_modal_uuids_length_mismatch_raises():
...
@@ -42,6 +42,16 @@ def test_multi_modal_uuids_length_mismatch_raises():
mm_data
=
{
"image"
:
[
cherry_pil_image
,
stop_pil_image
]}
mm_data
=
{
"image"
:
[
cherry_pil_image
,
stop_pil_image
]}
# Mismatch: 2 items but only 0 uuids provided
mm_uuids
=
{
"image"
:
[]}
# type: ignore[var-annotated]
mm_processor
=
renderer
.
get_mm_processor
()
mm_data_items
=
mm_processor
.
info
.
parse_mm_data
(
mm_data
)
mm_uuid_items
=
parse_mm_uuids
(
mm_uuids
)
with
pytest
.
raises
(
ValueError
,
match
=
"must have same length as"
):
renderer
.
_process_mm_uuids
(
mm_data
,
mm_data_items
,
mm_uuid_items
,
"req-1a"
)
# Mismatch: 2 items but only 1 uuid provided
# Mismatch: 2 items but only 1 uuid provided
mm_uuids
=
{
"image"
:
[
"hash_cherry"
]}
mm_uuids
=
{
"image"
:
[
"hash_cherry"
]}
...
@@ -50,7 +60,7 @@ def test_multi_modal_uuids_length_mismatch_raises():
...
@@ -50,7 +60,7 @@ def test_multi_modal_uuids_length_mismatch_raises():
mm_uuid_items
=
parse_mm_uuids
(
mm_uuids
)
mm_uuid_items
=
parse_mm_uuids
(
mm_uuids
)
with
pytest
.
raises
(
ValueError
,
match
=
"must have same length as"
):
with
pytest
.
raises
(
ValueError
,
match
=
"must have same length as"
):
renderer
.
_process_mm_uuids
(
mm_data
,
mm_data_items
,
mm_uuid_items
,
"req-1"
)
renderer
.
_process_mm_uuids
(
mm_data
,
mm_data_items
,
mm_uuid_items
,
"req-1
b
"
)
def
test_multi_modal_uuids_missing_modality_raises
():
def
test_multi_modal_uuids_missing_modality_raises
():
...
@@ -125,8 +135,8 @@ def test_multi_modal_uuids_accepts_empty(
...
@@ -125,8 +135,8 @@ def test_multi_modal_uuids_accepts_empty(
# While None means cached multi-modal input requiring UUIDs
# While None means cached multi-modal input requiring UUIDs
# an empty list means no multi-modal input
# an empty list means no multi-modal input
mm_data
=
{
"image"
:
[],
"video"
:
[]}
# type: ignore[var-annotated]
mm_data
=
{
"image"
:
[],
"video"
:
[]
,
"audio"
:
None
}
# type: ignore[var-annotated]
mm_uuids
=
{
"image"
:
[],
"video"
:
None
}
# type: ignore[var-annotated]
mm_uuids
=
{
"image"
:
[],
"video"
:
None
,
"audio"
:
[]
}
# type: ignore[var-annotated]
mm_processor
=
renderer
.
get_mm_processor
()
mm_processor
=
renderer
.
get_mm_processor
()
mm_data_items
=
mm_processor
.
info
.
parse_mm_data
(
mm_data
)
mm_data_items
=
mm_processor
.
info
.
parse_mm_data
(
mm_data
)
...
...
vllm/renderers/base.py
View file @
13913788
...
@@ -482,7 +482,7 @@ class BaseRenderer(ABC, Generic[_T]):
...
@@ -482,7 +482,7 @@ class BaseRenderer(ABC, Generic[_T]):
)
)
elif
uuid_items
is
not
None
:
elif
uuid_items
is
not
None
:
if
len
(
uuid_items
)
>
0
and
len
(
data_items
)
!=
len
(
uuid_items
):
if
len
(
data_items
)
!=
len
(
uuid_items
):
raise
ValueError
(
raise
ValueError
(
f
"If given, multi_modal_uuids[
{
modality
!
r
}
] must have "
f
"If given, multi_modal_uuids[
{
modality
!
r
}
] must have "
f
"same length as multi_modal_data[
{
modality
!
r
}
], but "
f
"same length as multi_modal_data[
{
modality
!
r
}
], but "
...
...
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