From 219c2482ab755fbd4e49dfbdee91bf1a8a4ec49a Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 19 五月 2023 11:33:27 +0800
Subject: [PATCH] websocket 2pass bugfix
---
funasr/bin/vad_inference_launch.py | 10 +++++++---
1 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/funasr/bin/vad_inference_launch.py b/funasr/bin/vad_inference_launch.py
index 1f17c5b..b17d058 100644
--- a/funasr/bin/vad_inference_launch.py
+++ b/funasr/bin/vad_inference_launch.py
@@ -239,9 +239,13 @@
ibest_writer = None
vad_results = []
- batch_in_cache = param_dict['in_cache'] if param_dict is not None else dict()
- is_final = param_dict.get('is_final', False) if param_dict is not None else False
- max_end_sil = param_dict.get('max_end_sil', 800) if param_dict is not None else 800
+ if param_dict is None:
+ param_dict = dict()
+ param_dict['in_cache'] = dict()
+ param_dict['is_final'] = True
+ batch_in_cache = param_dict.get('in_cache', dict())
+ is_final = param_dict.get('is_final', False)
+ max_end_sil = param_dict.get('max_end_sil', 800)
for keys, batch in loader:
assert isinstance(batch, dict), type(batch)
assert all(isinstance(s, str) for s in keys), keys
--
Gitblit v1.9.1