From 7375292887752a995cef6f77f3d837db67c981a4 Mon Sep 17 00:00:00 2001
From: jmwang66 <wangjiaming.wjm@alibaba-inc.com>
Date: 星期五, 16 六月 2023 10:09:39 +0800
Subject: [PATCH] Merge branch 'main' into dev_wjm_infer

---
 funasr/runtime/websocket/funasr-wss-server.cpp |   39 ++++++++++++++++++++-------------------
 1 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/funasr/runtime/websocket/funasr-ws-server.cpp b/funasr/runtime/websocket/funasr-wss-server.cpp
similarity index 80%
rename from funasr/runtime/websocket/funasr-ws-server.cpp
rename to funasr/runtime/websocket/funasr-wss-server.cpp
index 67a0f2d..5f2af5c 100644
--- a/funasr/runtime/websocket/funasr-ws-server.cpp
+++ b/funasr/runtime/websocket/funasr-wss-server.cpp
@@ -5,7 +5,7 @@
 /* 2022-2023 by zhaomingwork */
 
 // io server
-// Usage:websocketmain  [--model_thread_num <int>] [--decoder_thread_num <int>]
+// Usage:funasr-ws-server  [--model_thread_num <int>] [--decoder_thread_num <int>]
 //                    [--io_thread_num <int>] [--port <int>] [--listen_ip
 //                    <string>] [--punc-quant <string>] [--punc-dir <string>]
 //                    [--vad-quant <string>] [--vad-dir <string>] [--quantize
@@ -15,44 +15,43 @@
 using namespace std;
 void GetValue(TCLAP::ValueArg<std::string>& value_arg, string key,
               std::map<std::string, std::string>& model_path) {
-  if (value_arg.isSet()) {
     model_path.insert({key, value_arg.getValue()});
     LOG(INFO) << key << " : " << value_arg.getValue();
-  }
 }
 int main(int argc, char* argv[]) {
   try {
     google::InitGoogleLogging(argv[0]);
     FLAGS_logtostderr = true;
 
-    TCLAP::CmdLine cmd("websocketmain", ' ', "1.0");
+    TCLAP::CmdLine cmd("funasr-ws-server", ' ', "1.0");
     TCLAP::ValueArg<std::string> model_dir(
         "", MODEL_DIR,
-        "the asr model path, which contains model.onnx, config.yaml, am.mvn",
-        true, "", "string");
+        "default: /workspace/models/asr, the asr model path, which contains model.onnx, config.yaml, am.mvn",
+        false, "/workspace/models/asr", "string");
     TCLAP::ValueArg<std::string> quantize(
         "", QUANTIZE,
-        "false (Default), load the model of model.onnx in model_dir. If set "
+        "true (Default), load the model of model.onnx in model_dir. If set "
         "true, load the model of model_quant.onnx in model_dir",
-        false, "false", "string");
+        false, "true", "string");
     TCLAP::ValueArg<std::string> vad_dir(
         "", VAD_DIR,
-        "the vad model path, which contains model.onnx, vad.yaml, vad.mvn",
-        false, "", "string");
+        "default: /workspace/models/vad, the vad model path, which contains model.onnx, vad.yaml, vad.mvn",
+        false, "/workspace/models/vad", "string");
     TCLAP::ValueArg<std::string> vad_quant(
         "", VAD_QUANT,
-        "false (Default), load the model of model.onnx in vad_dir. If set "
+        "true (Default), load the model of model.onnx in vad_dir. If set "
         "true, load the model of model_quant.onnx in vad_dir",
-        false, "false", "string");
+        false, "true", "string");
     TCLAP::ValueArg<std::string> punc_dir(
         "", PUNC_DIR,
-        "the punc model path, which contains model.onnx, punc.yaml", false, "",
+        "default: /workspace/models/punc, the punc model path, which contains model.onnx, punc.yaml", 
+        false, "/workspace/models/punc",
         "string");
     TCLAP::ValueArg<std::string> punc_quant(
         "", PUNC_QUANT,
-        "false (Default), load the model of model.onnx in punc_dir. If set "
+        "true (Default), load the model of model.onnx in punc_dir. If set "
         "true, load the model of model_quant.onnx in punc_dir",
-        false, "false", "string");
+        false, "true", "string");
 
     TCLAP::ValueArg<std::string> listen_ip("", "listen_ip", "listen_ip", false,
                                            "0.0.0.0", "string");
@@ -64,10 +63,12 @@
     TCLAP::ValueArg<int> model_thread_num("", "model_thread_num",
                                           "model_thread_num", false, 1, "int");
 
-    TCLAP::ValueArg<std::string> certfile("", "certfile", "certfile", false, "",
-                                          "string");
-    TCLAP::ValueArg<std::string> keyfile("", "keyfile", "keyfile", false, "",
-                                         "string");
+    TCLAP::ValueArg<std::string> certfile("", "certfile", 
+        "default: ../../../ssl_key/server.crt, path of certficate for WSS connection. if it is empty, it will be in WS mode.", 
+        false, "../../../ssl_key/server.crt", "string");
+    TCLAP::ValueArg<std::string> keyfile("", "keyfile", 
+        "default: ../../../ssl_key/server.key, path of keyfile for WSS connection", 
+        false, "../../../ssl_key/server.key", "string");
 
     cmd.add(certfile);
     cmd.add(keyfile);

--
Gitblit v1.9.1