run_server.sh 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. download_model_dir="/workspace/models"
  2. model_dir="damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-onnx"
  3. vad_dir="damo/speech_fsmn_vad_zh-cn-16k-common-onnx"
  4. punc_dir=""
  5. itn_dir=""
  6. lm_dir=""
  7. port=10095
  8. certfile="../../../ssl_key/server.crt"
  9. keyfile="../../../ssl_key/server.key"
  10. hotword="../../hotwords.txt"
  11. # set decoder_thread_num
  12. decoder_thread_num=$(cat /proc/cpuinfo | grep "processor"|wc -l) || { echo "Get cpuinfo failed. Set decoder_thread_num = 32"; decoder_thread_num=32; }
  13. decoder_thread_num=8
  14. multiple_io=16
  15. io_thread_num=$(( (decoder_thread_num + multiple_io - 1) / multiple_io ))
  16. model_thread_num=5
  17. . ./tools/utils/parse_options.sh || exit 1;
  18. if [ -z "$certfile" ] || [ "$certfile" = "0" ]; then
  19. certfile=""
  20. keyfile=""
  21. fi
  22. cd /workspace/FunASR/runtime/websocket/build/bin
  23. ./funasr-wss-server \
  24. --download-model-dir "${download_model_dir}" \
  25. --model-dir "${model_dir}" \
  26. --vad-dir "${vad_dir}" \
  27. --punc-dir "${punc_dir}" \
  28. --itn-dir "${itn_dir}" \
  29. --lm-dir "${lm_dir}" \
  30. --decoder-thread-num ${decoder_thread_num} \
  31. --model-thread-num ${model_thread_num} \
  32. --io-thread-num ${io_thread_num} \
  33. --port ${port} \
  34. --certfile "${certfile}" \
  35. --keyfile "${keyfile}" \
  36. --hotword "${hotword}"