分块的长音频时间戳单调地偏移(1 小时内为 2.36 秒),因为在累加之前,分块偏移量被取整除以 2。
作者: udsy19创建于 2026年8月18日更新于 2026年9月27日
标签community-request
Steps/Code to reproduce bug
import torch
from nemo.collections.asr.parts.utils.rnnt_utils import Hypothesis
from nemo.collections.asr.parts.utils.chunking_utils import join_char_level_timestamps
SUB, STRIDE, NCHUNK, ENC_LEN = 8, 0.01, 60, 750 # 60 chunks of ~60 s == 1 hour of audio
chunk_offsets = [0] + [(ENC_LEN * SUB - 100)] * (NCHUNK - 1) # cf. merge_parallel_chunks:77-80
hyps = [
Hypothesis(score=0.0, y_sequence=torch.tensor([1]),
timestamp={"char": [{"token_id": 1, "start_offset": 0, "end_offset": 1, "char": "a"}]})
for _ in range(NCHUNK)
]
out = join_char_level_timestamps(hyps, chunk_offsets, SUB, STRIDE, merged_tokens=None)
print("current :", out[-1]["start_offset"])
print("exact :", sum(chunk_offsets) / SUB)Output:
内容来源: NVIDIA-NeMo/Speech