From 19f4fae784210e85421ae2f8dcd0fbbd1eb2ad3e Mon Sep 17 00:00:00 2001 From: lingyunfly <121302812+lingyunfly@users.noreply.github.com> Date: Thu, 18 May 2023 14:15:27 +0800 Subject: [PATCH] Update vad_inference_launch.py --- funasr/bin/vad_inference_launch.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/funasr/bin/vad_inference_launch.py b/funasr/bin/vad_inference_launch.py index 1f17c5bee..0878c9d58 100644 --- a/funasr/bin/vad_inference_launch.py +++ b/funasr/bin/vad_inference_launch.py @@ -239,9 +239,13 @@ def inference_vad_online( 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