From 7a9c0414b685b6f2ad7538017e2a1215e1e76901 Mon Sep 17 00:00:00 2001
From: Shi Xian <40013335+R1ckShi@users.noreply.github.com>
Date: 星期二, 11 六月 2024 11:42:15 +0800
Subject: [PATCH] Merge pull request #1791 from dtlzhuangz/zhuangzhong_dev

---
 funasr/auto/auto_model.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index e8ca008..9b4f6d9 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -359,6 +359,7 @@
             results_sorted = []
 
             if not len(sorted_data):
+                results_ret_list.append({"key": key, "text": "", "timestamp": []})
                 logging.info("decoding, utt: {}, empty speech".format(key))
                 continue
 
@@ -387,6 +388,7 @@
                 ):
                     max_len_in_batch = max(max_len_in_batch, sample_length)
                     end_idx += 1
+                    results_sorted.append({'key': 'bad_data', 'text': '', 'timestamp': []})
                     continue
 
                 speech_j, speech_lengths_j = slice_padding_audio_samples(
@@ -416,7 +418,7 @@
                 end_idx += 1
                 max_len_in_batch = sample_length
                 if len(results) < 1:
-                    continue
+                    results.append({'key': 'bad_data', 'text': '', 'timestamp': []})
                 results_sorted.extend(results)
 
             # end_asr_total = time.time()

--
Gitblit v1.9.1