bridge.models.qwen3_asr.modeling_qwen3_asr.rope#
Module Contents#
Functions#
Calculate the 3D rope index for Qwen3-ASR. |
API#
- bridge.models.qwen3_asr.modeling_qwen3_asr.rope.get_rope_index(
- input_ids: torch.LongTensor,
- attention_mask: torch.Tensor | None = None,
Calculate the 3D rope index for Qwen3-ASR.
Simplified version for audio-only model: just cumulative position IDs expanded to 3 MRoPE dimensions. No special vision/video handling needed.
Ported from HF Qwen3ASRPreTrainedModelForConditionalGeneration.get_rope_index.
- Parameters:
input_ids – Input token IDs of shape (batch_size, sequence_length).
attention_mask – Attention mask of shape (batch_size, sequence_length).
- Returns:
Position IDs of shape (3, batch_size, sequence_length). mrope_position_deltas: Position deltas of shape (batch_size, 1).
- Return type: