Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 7 additions & 5 deletions vllm/model_executor/models/qwen2_5_omni_thinker.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,11 @@ def _get_feature_tensor(feature: MultiModalFeatureSpec, key: str) -> torch.Tenso


def unpad_and_flat_audio_features(
input_audio_features: torch.Tensor,
input_audio_features: torch.Tensor | Sequence[torch.Tensor],
audio_feature_lengths: torch.Tensor,
) -> torch.Tensor:
"""Unpad and flatten batched audio features."""
if len(audio_feature_lengths) != input_audio_features.size(0):
"""Unpad and flatten stacked or ragged per-audio features."""
if len(audio_feature_lengths) != len(input_audio_features):
raise ValueError(
"Length of audio_feature_lengths must match "
"the batch size of input_audio_features."
Expand Down Expand Up @@ -920,8 +920,10 @@ def _parse_and_validate_audio_input(

# inputs features from rust frontend is batched and padded
# with shape [batch_size, n_mels, padded_seq_len], different
# from python's shape [n_mels, batch_size * seq_len]
if (
# from python's shape [n_mels, batch_size * seq_len].
# Requests with different padded lengths are batched as a
# list of [n_mels, padded_seq_len] tensors.
if isinstance(input_audio_features, (list, tuple)) or (
isinstance(input_audio_features, torch.Tensor)
and input_audio_features.dim() == 3
):
Expand Down
6 changes: 4 additions & 2 deletions vllm/model_executor/models/qwen3_asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,8 +478,10 @@ def _parse_and_validate_audio_input(

# inputs features from rust frontend is batched and padded
# with shape [batch_size, n_mels, padded_seq_len], different
# from python's shape [n_mels, batch_size * seq_len]
if (
# from python's shape [n_mels, batch_size * seq_len].
# Requests with different padded lengths are batched as a
# list of [n_mels, padded_seq_len] tensors.
if isinstance(input_audio_features, (list, tuple)) or (
isinstance(input_audio_features, torch.Tensor)
and input_audio_features.dim() == 3
):
Expand Down
Loading