From 3c83d64c84602de055f503af7d4e2761c829ec2e Mon Sep 17 00:00:00 2001
From: 雾聪 <wucong.lyb@alibaba-inc.com>
Date: 星期二, 12 十二月 2023 11:11:02 +0800
Subject: [PATCH] fst: support eng hotword
---
runtime/websocket/bin/funasr-wss-server-2pass.cpp | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/runtime/websocket/bin/funasr-wss-server-2pass.cpp b/runtime/websocket/bin/funasr-wss-server-2pass.cpp
index f0a4251..40f8f07 100644
--- a/runtime/websocket/bin/funasr-wss-server-2pass.cpp
+++ b/runtime/websocket/bin/funasr-wss-server-2pass.cpp
@@ -99,11 +99,11 @@
"0.0.0.0", "string");
TCLAP::ValueArg<int> port("", "port", "port", false, 10095, "int");
TCLAP::ValueArg<int> io_thread_num("", "io-thread-num", "io thread num",
- false, 8, "int");
+ false, 2, "int");
TCLAP::ValueArg<int> decoder_thread_num(
"", "decoder-thread-num", "decoder thread num", false, 8, "int");
TCLAP::ValueArg<int> model_thread_num("", "model-thread-num",
- "model thread num", false, 4, "int");
+ "model thread num", false, 2, "int");
TCLAP::ValueArg<std::string> certfile(
"", "certfile",
@@ -234,6 +234,16 @@
std::string down_asr_path;
std::string down_asr_model;
+ size_t found = s_offline_asr_path.find("speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404");
+ if (found != std::string::npos) {
+ model_path["offline-model-revision"]="v1.2.4";
+ } else{
+ found = s_offline_asr_path.find("speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404");
+ if (found != std::string::npos) {
+ model_path["offline-model-revision"]="v1.0.5";
+ }
+ }
+
if (access(s_offline_asr_path.c_str(), F_OK) == 0) {
// local
python_cmd_asr = python_cmd + " --model-name " + s_offline_asr_path +
@@ -242,16 +252,6 @@
down_asr_path = s_offline_asr_path;
}
else {
- size_t found = s_offline_asr_path.find("speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404");
- if (found != std::string::npos) {
- model_path["offline-model-revision"]="v1.2.4";
- } else{
- found = s_offline_asr_path.find("speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404");
- if (found != std::string::npos) {
- model_path["offline-model-revision"]="v1.0.5";
- }
- }
-
// modelscope
LOG(INFO) << "Download model: " << s_offline_asr_path
<< " from modelscope : ";
--
Gitblit v1.9.1