Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
change
sglang
Commits
fde2decf
"vscode:/vscode.git/clone" did not exist on "680c74593d6e6da40745f1e8feff0bdfd935bc67"
Unverified
Commit
fde2decf
authored
Oct 22, 2025
by
Zheng Wengang
Committed by
GitHub
Oct 21, 2025
Browse files
[BugFix][Qwen3-VL]: add metadata for video in qwen3-vl (#11377)
parent
9792b9d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
8 deletions
+26
-8
python/sglang/srt/multimodal/processors/qwen_vl.py
python/sglang/srt/multimodal/processors/qwen_vl.py
+26
-8
No files found.
python/sglang/srt/multimodal/processors/qwen_vl.py
View file @
fde2decf
...
@@ -214,7 +214,14 @@ async def preprocess_video(
...
@@ -214,7 +214,14 @@ async def preprocess_video(
interpolation
=
InterpolationMode
.
BICUBIC
,
interpolation
=
InterpolationMode
.
BICUBIC
,
antialias
=
True
,
antialias
=
True
,
).
float
()
).
float
()
return
video
video_metadata
=
{
"fps"
:
video_fps
,
"duration"
:
total_frames
/
video_fps
,
"total_num_frames"
:
total_frames
,
"frames_indices"
:
idx
,
"video_backend"
:
"torchvision"
,
}
return
video
,
video_metadata
# Compatible with Qwen-VL & Qwen-Omni Series
# Compatible with Qwen-VL & Qwen-Omni Series
...
@@ -279,14 +286,25 @@ class QwenVLImageProcessor(SGLangBaseProcessor):
...
@@ -279,14 +286,25 @@ class QwenVLImageProcessor(SGLangBaseProcessor):
resize_tasks
=
[
resize_image_async
(
image
)
for
image
in
base_output
.
images
]
resize_tasks
=
[
resize_image_async
(
image
)
for
image
in
base_output
.
images
]
base_output
.
images
=
await
asyncio
.
gather
(
*
resize_tasks
)
base_output
.
images
=
await
asyncio
.
gather
(
*
resize_tasks
)
video_metadata
=
None
if
base_output
.
videos
:
if
base_output
.
videos
:
base_output
.
videos
=
[
video_results
=
await
asyncio
.
gather
(
await
preprocess_video
(
video
)
for
video
in
base_output
.
videos
*
[
preprocess_video
(
video
)
for
video
in
base_output
.
videos
]
]
)
base_output
.
videos
,
video_metadata
=
map
(
list
,
zip
(
*
video_results
))
mm_items
,
input_ids
,
ret
=
self
.
process_and_combine_mm_data
(
base_output
,
self
.
mm_tokens
# NOTE: for qwen3-vl, video_meta need to be passed in, since do_sample_frames is already done in preprocess_video
)
if
self
.
hf_config
.
model_type
in
(
"qwen3_vl"
,
"qwen3_vl_moe"
):
mm_items
,
input_ids
,
ret
=
self
.
process_and_combine_mm_data
(
base_output
,
self
.
mm_tokens
,
video_metadata
=
video_metadata
,
do_sample_frames
=
False
,
)
else
:
mm_items
,
input_ids
,
ret
=
self
.
process_and_combine_mm_data
(
base_output
,
self
.
mm_tokens
)
audio_feature_lengths
=
None
audio_feature_lengths
=
None
...
...
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