mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
bug fix for asr_launch empty speech (#709)
This commit is contained in:
parent
c20c871e9f
commit
11daec8222
@ -619,6 +619,22 @@ def inference_paraformer_vad_punc(
|
||||
sorted_data = sorted(data_with_index, key=lambda x: x[0][1] - x[0][0])
|
||||
results_sorted = []
|
||||
|
||||
if not len(sorted_data):
|
||||
key = keys[0]
|
||||
# no active segments after VAD
|
||||
if writer is not None:
|
||||
# Write empty results
|
||||
ibest_writer["token"][key] = ""
|
||||
ibest_writer["token_int"][key] = ""
|
||||
ibest_writer["vad"][key] = ""
|
||||
ibest_writer["text"][key] = ""
|
||||
ibest_writer["text_with_punc"][key] = ""
|
||||
if use_timestamp:
|
||||
ibest_writer["time_stamp"][key] = ""
|
||||
|
||||
logging.info("decoding, utt: {}, empty speech".format(key))
|
||||
continue
|
||||
|
||||
batch_size_token_ms = batch_size_token*60
|
||||
if speech2text.device == "cpu":
|
||||
batch_size_token_ms = 0
|
||||
|
||||
Loading…
Reference in New Issue
Block a user