From cf3194469d4f03f1f9df442db3fb190e9a05d73f Mon Sep 17 00:00:00 2001
From: yhliang <68215459+yhliang-aslp@users.noreply.github.com>
Date: 星期三, 17 五月 2023 14:16:45 +0800
Subject: [PATCH] Merge pull request #521 from alibaba-damo-academy/main

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

diff --git a/funasr/bin/modelscope_infer.py b/funasr/bin/modelscope_infer.py
index 74c2fb7..bc24340 100755
--- a/funasr/bin/modelscope_infer.py
+++ b/funasr/bin/modelscope_infer.py
@@ -17,7 +17,7 @@
                         help="model name in modelscope")
     parser.add_argument("--model_revision",
                         type=str,
-                        default="v1.0.3",
+                        default="v1.0.4",
                         help="model revision in modelscope")
     parser.add_argument("--local_model_path",
                         type=str,
@@ -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