FunASR/funasr/runtime/python/http
2023-09-14 10:55:16 +08:00
..
client.py Optimize print (#948) 2023-09-14 10:55:16 +08:00
README.md add python http code (#940) 2023-09-13 09:30:38 +08:00
requirements.txt add python http code (#940) 2023-09-13 09:30:38 +08:00
server.py Optimize print (#948) 2023-09-14 10:55:16 +08:00

Service with http-python

Server

  1. Install requirements
cd funasr/runtime/python/http
pip install -r requirements.txt
  1. Start server
python server.py --port 8000

More parameters:

python server.py \
--host [host ip] \
--port [server port] \
--asr_model [asr model_name] \
--punc_model [punc model_name] \
--ngpu [0 or 1] \
--ncpu [1 or 4] \
--certfile [path of certfile for ssl] \
--keyfile [path of keyfile for ssl] \
--temp_dir [upload file temp dir] 

Client

# get test audio file
wget https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav
python client.py --host=127.0.0.1 --port=8000 --audio_path=asr_example_zh.wav

More parameters:

python server.py \
--host [sever ip] \
--port [sever port] \
--add_pun [add pun to result] \
--audio_path [use audio path]