vllm.model_executor.models.qwen2_audio
¶
Inference-only Qwen2-Audio model compatible with HuggingFace weights.
Classes:
-
Qwen2AudioAttention–Self-attention over packed tokens with fused QKV and MMEncoderAttention.
-
Qwen2AudioEmbeddingInputs–Dimensions:
-
Qwen2AudioEncoder–Qwen2-Audio audio tower that runs the batch as one packed sequence.
-
Qwen2AudioFeatureInputs–Dimensions:
-
Qwen2AudioProcessingInfo–
Functions:
-
packed_position_ids–Position of every valid token, restarted at 0 for each item.
-
pool_packed_hidden_states–Stride-2 average pool each packed item, dropping any trailing odd token.
Qwen2AudioAttention
¶
Qwen2AudioEmbeddingInputs
¶
Bases: TensorSchema
Dimensions: - bn: Batch size - naf: Number of audio features - hs: Hidden size (must match the hidden size of language model backbone)
Qwen2AudioEncoder
¶
Bases: Module
Qwen2-Audio audio tower that runs the batch as one packed sequence.
Loads HuggingFace Qwen2AudioEncoder checkpoints into fused QKV and
parallel linear layers while running valid frames as a single packed
varlen sequence bounded per item by cu_seqlens.
Qwen2AudioFeatureInputs
¶
Qwen2AudioProcessingInfo
¶
Bases: BaseProcessingInfo
Methods:
-
get_target_channels–Return target audio channels for Qwen2 Audio models (mono).
get_target_channels()
¶
Return target audio channels for Qwen2 Audio models (mono).
packed_position_ids(lengths, device)
¶
Position of every valid token, restarted at 0 for each item.
pool_packed_hidden_states(packed, lengths)
¶
Stride-2 average pool each packed item, dropping any trailing odd token.