From bd9ed054110636a0a2fa065fd851d19e444b9505 Mon Sep 17 00:00:00 2001 From: lyblsgo <wucong.lyb@alibaba-inc.com> Date: 星期三, 11 十月 2023 19:47:18 +0800 Subject: [PATCH] update docs for server instructions --- funasr/runtime/docs/SDK_advanced_guide_offline.md | 52 +++++++++++++++++++++++++++++----------------------- 1 files changed, 29 insertions(+), 23 deletions(-) diff --git a/funasr/runtime/docs/SDK_advanced_guide_offline.md b/funasr/runtime/docs/SDK_advanced_guide_offline.md index 63276eb..a674b9b 100644 --- a/funasr/runtime/docs/SDK_advanced_guide_offline.md +++ b/funasr/runtime/docs/SDK_advanced_guide_offline.md @@ -49,7 +49,6 @@ ``` - ## Starting the server Use the flollowing script to start the server 锛� @@ -65,15 +64,16 @@ # If you want to deploy the timestamp or hotword model, please set --model-dir to the corresponding model: # speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-onnx锛坱imestamp锛� # damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404-onnx锛坔otword锛� + ``` -More details about the script run_server.sh: +### More details about the script run_server.sh: -The FunASR-wss-server supports downloading models from Modelscope. You can set the model download address (--download-model-dir, default is /workspace/models) and the model ID (--model-dir, --vad-dir, --punc-dir). Here is an example: +The funasr-wss-server supports downloading models from Modelscope. You can set the model download address (--download-model-dir, default is /workspace/models) and the model ID (--model-dir, --vad-dir, --punc-dir). Here is an example: ```shell -cd /workspace/FunASR/funasr/runtime/websocket/build/bin -./funasr-wss-server \ +cd /workspace/FunASR/funasr/runtime +nohup bash run_server.sh \ --download-model-dir /workspace/models \ --model-dir damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-onnx \ --vad-dir damo/speech_fsmn_vad_zh-cn-16k-common-onnx \ @@ -83,10 +83,10 @@ --io-thread-num 8 \ --port 10095 \ --certfile ../../../ssl_key/server.crt \ - --keyfile ../../../ssl_key/server.key + --keyfile ../../../ssl_key/server.key > log.out 2>&1 & ``` -Introduction to command parameters: +Introduction to run_server.sh parameters: ```text --download-model-dir: Model download address, download models from Modelscope by setting the model ID. @@ -100,25 +100,31 @@ --port: Port number that the server listens on. Default is 10095. --decoder-thread-num: Number of inference threads that the server starts. Default is 8. --io-thread-num: Number of IO threads that the server starts. Default is 1. ---certfile <string>: SSL certificate file. Default is ../../../ssl_key/server.crt. If you want to close ssl锛宻et "" ---keyfile <string>: SSL key file. Default is ../../../ssl_key/server.key. If you want to close ssl锛宻et "" +--certfile <string>: SSL certificate file. Default is ../../../ssl_key/server.crt. If you want to close ssl锛宻et 0 +--keyfile <string>: SSL key file. Default is ../../../ssl_key/server.key. ``` -The FunASR-wss-server also supports loading models from a local path (see Preparing Model Resources for detailed instructions on preparing local model resources). Here is an example: +### Shutting Down the FunASR Service +```text +# Check the PID of the funasr-wss-server process +ps -x | grep funasr-wss-server +kill -9 PID +``` -```shell -cd /workspace/FunASR/funasr/runtime/websocket/build/bin -./funasr-wss-server \ - --model-dir /workspace/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-onnx \ - --vad-dir /workspace/models/damo/speech_fsmn_vad_zh-cn-16k-common-onnx \ - --punc-dir /workspace/models/damo/punc_ct-transformer_zh-cn-common-vocab272727-onnx \ - --itn-dir /workspace/models/thuduj12/fst_itn_zh \ - --decoder-thread-num 32 \ - --io-thread-num 8 \ - --port 10095 \ - --certfile ../../../ssl_key/server.crt \ - --keyfile ../../../ssl_key/server.key - ``` +### Modifying Models and Other Parameters +To replace the currently used model or other parameters, you need to first shut down the FunASR service, make the necessary modifications to the parameters you want to replace, and then restart the FunASR service. The model should be either an ASR/VAD/PUNC model from ModelScope or a fine-tuned model obtained from ModelScope. +```text +# For example, to replace the ASR model with damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-onnx, use the following parameter setting --model-dir + --model-dir damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-onnx +# Set the port number using --port + --port <port number> +# Set the number of inference threads the server will start using --decoder-thread-num + --decoder-thread-num <decoder thread num> +# Set the number of IO threads the server will start using --io-thread-num + --io-thread-num <io thread num> +# Disable SSL certificate + --certfile 0 +``` After executing the above command, the real-time speech transcription service will be started. If the model is specified as a ModelScope model id, the following models will be automatically downloaded from ModelScope: [FSMN-VAD](https://www.modelscope.cn/models/damo/speech_fsmn_vad_zh-cn-16k-common-onnx/summary) -- Gitblit v1.9.1