From 4853dffdc4e70552f5b4348ef29089ed04927d95 Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期五, 17 二月 2023 11:43:40 +0800
Subject: [PATCH] Merge pull request #131 from alibaba-damo-academy/dev_lyb

---
 funasr/bin/modelscope_infer.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/funasr/bin/modelscope_infer.py b/funasr/bin/modelscope_infer.py
index 3be6d03..bc24340 100755
--- a/funasr/bin/modelscope_infer.py
+++ b/funasr/bin/modelscope_infer.py
@@ -82,6 +82,9 @@
             wav_id, wav_path = line.strip().split()
             logging.info("decoding, utt_id: ['{}']".format(wav_id))
             rec_result = inference_pipeline(audio_in=wav_path)
-            text = rec_result["text"]
+            if 'text' in rec_result:
+                text = rec_result["text"]
+            else:
+                text = ''
             f_out.write(wav_id + " " + text + "\n")
             logging.info("best hypo: {} \n".format(text))

--
Gitblit v1.9.1