add batch support for token extraction

This commit is contained in:
志浩 2024-09-24 17:45:55 +08:00
parent 4f96a06d13
commit c37e04ea49

View File

@ -2060,6 +2060,6 @@ class SenseVoiceL(nn.Module):
ark_writer = self.writer
if ark_writer is not None:
for k, v, l in zip(key, tokens.detach().cpu().numpy(), out_lens):
ark_writer(k, tokens[:l])
ark_writer(k, v[:l])
return results, meta_data