From 0b5ab0709e8292447b314f4f02c74becafd6ce76 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期二, 19 九月 2023 12:33:53 +0800
Subject: [PATCH] wechat
---
funasr/runtime/onnxruntime/src/offline-stream.cpp | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/funasr/runtime/onnxruntime/src/offline-stream.cpp b/funasr/runtime/onnxruntime/src/offline-stream.cpp
index c042562..ae09a50 100644
--- a/funasr/runtime/onnxruntime/src/offline-stream.cpp
+++ b/funasr/runtime/onnxruntime/src/offline-stream.cpp
@@ -84,6 +84,22 @@
use_punc = true;
}
}
+
+ // Optional: ITN, here we just support language_type=MandarinEnglish
+ if(model_path.find(ITN_DIR) != model_path.end() && model_path.at(ITN_DIR) != ""){
+ string itn_tagger_path = PathAppend(model_path.at(ITN_DIR), ITN_TAGGER_NAME);
+ string itn_verbalizer_path = PathAppend(model_path.at(ITN_DIR), ITN_VERBALIZER_NAME);
+
+ if (access(itn_tagger_path.c_str(), F_OK) != 0 ||
+ access(itn_verbalizer_path.c_str(), F_OK) != 0 )
+ {
+ LOG(INFO) << "ITN model file is not exist, skip load ITN model.";
+ }else{
+ itn_handle = make_unique<ITNProcessor>();
+ itn_handle->InitITN(itn_tagger_path, itn_verbalizer_path, thread_num);
+ use_itn = true;
+ }
+ }
}
OfflineStream *CreateOfflineStream(std::map<std::string, std::string>& model_path, int thread_num)
--
Gitblit v1.9.1