From 1eb85d7d17a12877e36feefcb3bb2f20a2c171f0 Mon Sep 17 00:00:00 2001
From: speech_asr <wangjiaming.wjm@alibaba-inc.com>
Date: 星期二, 18 四月 2023 16:09:25 +0800
Subject: [PATCH] update

---
 funasr/models/predictor/cif.py |    9 ---------
 1 files changed, 0 insertions(+), 9 deletions(-)

diff --git a/funasr/models/predictor/cif.py b/funasr/models/predictor/cif.py
index deff6e4..e80a915 100644
--- a/funasr/models/predictor/cif.py
+++ b/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)
@@ -250,8 +243,6 @@
                 pre_alphas_length = cache["cif_alphas"].size(-1)
                 mask_chunk_peak_predictor[:, :pre_alphas_length] = 1.0
             mask_chunk_peak_predictor[:, pre_alphas_length + cache["pad_left"]:pre_alphas_length + cache["stride"] + cache["pad_left"]] = 1.0
-            #if cache["is_final"]:
-            #    mask_chunk_peak_predictor[:, -1] = 1.0
             
         if mask_chunk_peak_predictor is not None:
             cif_peak = cif_peak * mask_chunk_peak_predictor.squeeze(-1)

--
Gitblit v1.9.1