From a05e753d11d9c36983ec4e58c421dbcf86d1dcd4 Mon Sep 17 00:00:00 2001
From: Xian Shi <40013335+R1ckShi@users.noreply.github.com>
Date: 星期二, 17 十月 2023 16:47:27 +0800
Subject: [PATCH] Merge branch 'main' into dev_onnx

---
 funasr/runtime/python/http/README.md |   68 ++++++++++++++++++++++++++++++++++
 1 files changed, 68 insertions(+), 0 deletions(-)

diff --git a/funasr/runtime/python/http/README.md b/funasr/runtime/python/http/README.md
new file mode 100644
index 0000000..d9e01f5
--- /dev/null
+++ b/funasr/runtime/python/http/README.md
@@ -0,0 +1,68 @@
+# Service with http-python
+
+## Server
+
+1. Install requirements
+
+```shell
+cd funasr/runtime/python/http
+pip install -r requirements.txt
+```
+
+2. Start server
+
+```shell
+python server.py --port 8000
+```
+
+More parameters:
+```shell
+python server.py \
+--host [host ip] \
+--port [server port] \
+--asr_model [asr model_name] \
+--vad_model [vad model_name] \
+--punc_model [punc model_name] \
+--ngpu [0 or 1] \
+--ncpu [1 or 4] \
+--hotword_path [path of hot word txt] \
+--certfile [path of certfile for ssl] \
+--keyfile [path of keyfile for ssl] \
+--temp_dir [upload file temp dir] 
+```
+
+## Client
+
+```shell
+# 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:
+```shell
+python server.py \
+--host [sever ip] \
+--port [sever port] \
+--add_pun [add pun to result] \
+--audio_path [use audio path] 
+```
+
+
+## 鏀寔澶氳繘绋�
+
+鏂规硶鏄惎鍔ㄥ涓猔server.py`锛岀劧鍚庨�氳繃Nginx鐨勮礋杞藉潎琛″垎鍙戣姹傦紝杈惧埌鏀寔澶氱敤鎴峰悓鏃惰繛鏁堟灉锛屽鐞嗘柟寮忓涓嬶紝榛樿鎮ㄥ凡缁忓畨瑁呬簡Nginx锛屾病瀹夎鐨勮鍙傝�僛瀹樻柟瀹夎鏁欑▼](https://nginx.org/en/linux_packages.html#Ubuntu)銆�
+
+閰嶇疆Nginx銆�
+```shell
+sudo cp -f asr_nginx.conf /etc/nginx/nginx.conf
+sudo service nginx reload
+```
+
+鐒跺悗浣跨敤鑴氭湰鍚姩澶氫釜鏈嶅姟锛屾瘡涓湇鍔$殑绔彛鍙蜂笉涓�鏍枫��
+```shell
+sudo chmod +x start_server.sh
+./start_server.sh
+```
+
+**璇存槑锛�** 榛樿鏄�3涓繘绋嬶紝濡傛灉闇�瑕佷慨鏀癸紝棣栧厛淇敼`start_server.sh`鐨勬渶鍚庨偅閮ㄥ垎锛屽彲浠ユ坊鍔犲惎鍔ㄦ暟閲忋�傜劧鍚庝慨鏀筦asr_nginx.conf`閰嶇疆鏂囦欢鐨刞upstream backend`閮ㄥ垎锛屽鍔犳柊鍚姩鐨勬湇鍔★紝鍙互浣垮叾浠栨湇鍔″櫒鐨勬湇鍔°��

--
Gitblit v1.9.1