From 44fe2e811fed3d1d2341e54fa72a06931b011da1 Mon Sep 17 00:00:00 2001 From: lzr265946 Date: Thu, 9 Feb 2023 15:23:40 +0800 Subject: [PATCH] fix bug in predictor tail_process_fn --- funasr/models/predictor/cif.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/funasr/models/predictor/cif.py b/funasr/models/predictor/cif.py index c28146062..c34759d0d 100644 --- a/funasr/models/predictor/cif.py +++ b/funasr/models/predictor/cif.py @@ -598,7 +598,8 @@ class CifPredictorV3(nn.Module): mask_2 = torch.cat([ones_t, mask], dim=1) mask = mask_2 - mask_1 tail_threshold = mask * tail_threshold - alphas = torch.cat([alphas, tail_threshold], dim=1) + alphas = torch.cat([alphas, zeros_t], dim=1) + alphas = torch.add(alphas, tail_threshold) else: tail_threshold = torch.tensor([tail_threshold], dtype=alphas.dtype).to(alphas.device) tail_threshold = torch.reshape(tail_threshold, (1, 1))