From 0bd1a4d6a9893e45438505514a063d9deee91f21 Mon Sep 17 00:00:00 2001
From: Xingchen Song(宋星辰) <xingchensong1996@163.com>
Date: 星期二, 11 六月 2024 14:00:10 +0800
Subject: [PATCH] [fix] better solution for handling empty result (#1796)
---
funasr/auto/auto_model.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/funasr/auto/auto_model.py b/funasr/auto/auto_model.py
index 7b5a02f..191e172 100644
--- a/funasr/auto/auto_model.py
+++ b/funasr/auto/auto_model.py
@@ -427,6 +427,10 @@
# f"time_speech_total_per_sample: {time_speech_total_per_sample: 0.3f}, "
# f"time_escape_total_per_sample: {time_escape_total_per_sample:0.3f}")
+ if len(results_sorted) != n:
+ results_ret_list.append({"key": key, "text": "", "timestamp": []})
+ logging.info("decoding, utt: {}, empty result".format(key))
+ continue
restored_data = [0] * n
for j in range(n):
index = sorted_data[j][1]
--
Gitblit v1.9.1