From a6a9d29bbda05fce915957e58e87c9bfd4a22730 Mon Sep 17 00:00:00 2001 From: BOBOTANG Date: Fri, 22 Mar 2024 19:10:44 +0800 Subject: [PATCH] Expose the max_end_silence_time to the user (#1532) --- funasr/models/fsmn_vad_streaming/model.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/funasr/models/fsmn_vad_streaming/model.py b/funasr/models/fsmn_vad_streaming/model.py index 7d71faa37..f1d416104 100644 --- a/funasr/models/fsmn_vad_streaming/model.py +++ b/funasr/models/fsmn_vad_streaming/model.py @@ -543,6 +543,11 @@ class FsmnVADStreaming(nn.Module): cache["frontend"] = {} cache["prev_samples"] = torch.empty(0) cache["encoder"] = {} + + if kwargs.get("max_end_silence_time") is not None: + # update the max_end_silence_time + self.vad_opts.max_end_silence_time = kwargs.get("max_end_silence_time") + windows_detector = WindowDetector(self.vad_opts.window_size_ms, self.vad_opts.sil_to_speech_time_thres, self.vad_opts.speech_to_sil_time_thres,