Update vad_inference_launch.py

This commit is contained in:
lingyunfly 2023-05-18 14:15:27 +08:00 committed by GitHub
parent 17eaf419c0
commit 19f4fae784
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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