From 1677e441e34f4b33fccc37cff2466362a603a16e Mon Sep 17 00:00:00 2001
From: zhifu gao <zhifu.gzf@alibaba-inc.com>
Date: 星期四, 29 十二月 2022 13:19:28 +0800
Subject: [PATCH] Merge pull request #22 from alibaba-damo-academy/dev

---
 setup.py                       |    2 ++
 funasr/bin/modelscope_infer.py |    5 ++++-
 2 files changed, 6 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))
diff --git a/setup.py b/setup.py
index 05db779..767b3da 100644
--- a/setup.py
+++ b/setup.py
@@ -38,6 +38,8 @@
         "editdistance==0.5.2",
         "tensorboard>=1.14",
         "g2p",
+        # ITN
+        "pynini==2.1.5",
     ],
     # train: The modules invoked when training only.
     "train": [

--
Gitblit v1.9.1