From be7230fd94477fdc22a9b315af7c5e3ac4a7eb8d Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 28 二月 2023 16:20:45 +0800
Subject: [PATCH] Merge pull request #163 from alibaba-damo-academy/dev_zly
---
funasr/models/e2e_vad.py | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/funasr/models/e2e_vad.py b/funasr/models/e2e_vad.py
index c21be1b..b9be89a 100755
--- a/funasr/models/e2e_vad.py
+++ b/funasr/models/e2e_vad.py
@@ -444,7 +444,7 @@
def forward(self, feats: torch.Tensor, waveform: torch.tensor, in_cache: Dict[str, torch.Tensor] = dict(),
is_final: bool = False
- ) -> List[List[List[int]]]:
+ ) -> Tuple[List[List[List[int]]], Dict[str, torch.Tensor]]:
self.waveform = waveform # compute decibel for each frame
self.ComputeDecibel()
self.ComputeScores(feats, in_cache)
@@ -468,8 +468,7 @@
if is_final:
# reset class variables and clear the dict for the next query
self.AllResetDetection()
- in_cache.clear()
- return segments
+ return segments, in_cache
def DetectCommonFrames(self) -> int:
if self.vad_state_machine == VadStateMachine.kVadInStateEndPointDetected:
--
Gitblit v1.9.1