Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion vllm/model_executor/models/qwen2_vl.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,10 +831,12 @@ def get_num_video_tokens(
num_frames: int,
image_processor: Optional[Qwen2VLImageProcessor],
) -> int:
# NOTE: Frames are padded to the next even number
# https://github.com/huggingface/transformers/blob/v4.48.3/src/transformers/models/qwen2_vl/image_processing_qwen2_vl.py#L294
_, num_video_tokens = self._get_vision_info(
image_width=image_width,
image_height=image_height,
num_frames=num_frames,
num_frames=num_frames + num_frames % 2,
image_processor=image_processor,
)
return num_video_tokens
Expand Down