haoneng.lhn
2023-03-29 a65a408f2874a1b7993d68bebb683fa70b83c760
update
1个文件已修改
7 ■■■■■ 已修改文件
funasr/models/predictor/cif.py 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
funasr/models/predictor/cif.py
@@ -228,13 +228,6 @@
            if cache["cif_alphas"] is not None:
                alphas = torch.cat((cache["cif_alphas"], alphas), -1)
        #if cache["is_final"]:
        #    tail_threshold = torch.tensor([self.tail_threshold], dtype=alphas.dtype).to(alphas.device)
        #    tail_threshold = torch.reshape(tail_threshold, (1, 1))
        #    alphas = torch.cat([alphas, tail_threshold], dim=1)
        #    zeros_hidden = torch.zeros((b, 1, d), dtype=hidden.dtype).to(hidden.device)
        #    hidden = torch.cat([hidden, zeros_hidden], dim=1)
        token_num = alphas.sum(-1)
        acoustic_embeds, cif_peak = cif(hidden, alphas, self.threshold)
        len_time = alphas.size(-1)