From 5b6bd201412636b6d7fa85afaf24e42cd54e52cd Mon Sep 17 00:00:00 2001
From: jmwang66 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期五, 30 十二月 2022 18:50:07 +0800
Subject: [PATCH] Merge branch 'dev' of https://github.com/alibaba-damo-academy/FunASR into dev
---
funasr/models/predictor/cif.py | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/funasr/models/predictor/cif.py b/funasr/models/predictor/cif.py
index 2eba4e2..1d196a7 100644
--- a/funasr/models/predictor/cif.py
+++ b/funasr/models/predictor/cif.py
@@ -31,10 +31,12 @@
alphas = torch.sigmoid(output)
alphas = torch.nn.functional.relu(alphas * self.smooth_factor - self.noise_threshold)
if mask is not None:
- alphas = alphas * mask.transpose(-1, -2).float()
+ mask = mask.transpose(-1, -2).float()
+ alphas = alphas * mask
if mask_chunk_predictor is not None:
alphas = alphas * mask_chunk_predictor
alphas = alphas.squeeze(-1)
+ mask = mask.squeeze(-1)
if target_label_length is not None:
target_length = target_label_length
elif target_label is not None:
--
Gitblit v1.9.1