[Rust Frontend][gRPC] Add audio and video media inputs (#53760)

Signed-off-by: Connor Carpenter <connorc@nvidia.com>
This commit is contained in:
Connor Carpenter
2026-08-30 11:31:37 +08:00
committed by GitHub
parent b016ed8ea3
commit 7a67941c1d
4 changed files with 124 additions and 50 deletions
+4 -7
View File
@@ -575,13 +575,10 @@ class Qwen3ASRForConditionalGeneration(
for mm_feature in sorted(mm_features, key=lambda f: f.mm_position.offset):
offset = mm_feature.mm_position.offset
# Get audio feature length from mm_feature data
audio_feature_length = mm_feature.data["audio_feature_lengths"].data
if isinstance(audio_feature_length, torch.Tensor):
audio_feature_length = audio_feature_length.item()
audio_len = _get_feat_extract_output_lengths(
torch.tensor(audio_feature_length)
).item()
# The placeholder already contains one token per audio embedding.
# Use its length so M-RoPE can be reconstructed even when a covered
# prefix no longer carries the audio processor tensors.
audio_len = mm_feature.mm_position.length
# Text segment before audio (includes audio_start token)
text_len = offset - st