| runtime/python/libtorch/funasr_torch/sensevoice_bin.py | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
runtime/python/libtorch/funasr_torch/sensevoice_bin.py
@@ -170,8 +170,12 @@ torch.tensor(_language_list).to(self.device), torch.tensor(_textnorm_list).to(self.device), ) for b in range(feats.shape[0]): # back to torch.Tensor if isinstance(ctc_logits, np.ndarray): ctc_logits = torch.from_numpy(ctc_logits).float() # support batch_size=1 only currently x = ctc_logits[0, : encoder_out_lens[0].item(), :] x = ctc_logits[b, : encoder_out_lens[b].item(), :] yseq = x.argmax(dim=-1) yseq = torch.unique_consecutive(yseq, dim=-1)