From 6df05f2e24f4b357aee8614f238638b97b74e540 Mon Sep 17 00:00:00 2001
From: lingyunfly <121302812+lingyunfly@users.noreply.github.com>
Date: 星期四, 13 四月 2023 14:23:03 +0800
Subject: [PATCH] vad bug fix

---
 funasr/runtime/python/onnxruntime/funasr_onnx/utils/e2e_vad.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/funasr/runtime/python/onnxruntime/funasr_onnx/utils/e2e_vad.py b/funasr/runtime/python/onnxruntime/funasr_onnx/utils/e2e_vad.py
index f540765..029f529 100644
--- a/funasr/runtime/python/onnxruntime/funasr_onnx/utils/e2e_vad.py
+++ b/funasr/runtime/python/onnxruntime/funasr_onnx/utils/e2e_vad.py
@@ -470,8 +470,8 @@
                             end_ms = -1
                             self.next_seg = False
                     else:
-                        if not self.output_data_buf[i].contain_seg_start_point or not self.output_data_buf[
-                            i].contain_seg_end_point:
+                        if not is_final and (not self.output_data_buf[i].contain_seg_start_point or not self.output_data_buf[
+                            i].contain_seg_end_point):
                             continue
                         start_ms = self.output_data_buf[i].start_ms
                         end_ms = self.output_data_buf[i].end_ms

--
Gitblit v1.9.1