From 4ee715e70e36cdba7b05fe044fecab9cf4fa16ff Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期一, 03 七月 2023 17:23:02 +0800
Subject: [PATCH] websocket bug

---
 funasr/runtime/docs/SDK_tutorial_zh.md |   76 +++++++++++++++++++++----------------
 1 files changed, 43 insertions(+), 33 deletions(-)

diff --git a/funasr/runtime/docs/SDK_tutorial_zh.md b/funasr/runtime/docs/SDK_tutorial_zh.md
index 0497122..52ad927 100644
--- a/funasr/runtime/docs/SDK_tutorial_zh.md
+++ b/funasr/runtime/docs/SDK_tutorial_zh.md
@@ -1,7 +1,7 @@
 # FunASR绂荤嚎鏂囦欢杞啓鏈嶅姟渚挎嵎閮ㄧ讲鏁欑▼
 
 FunASR鎻愪緵鍙究鎹锋湰鍦版垨鑰呬簯绔湇鍔″櫒閮ㄧ讲鐨勭绾挎枃浠惰浆鍐欐湇鍔★紝鍐呮牳涓篎unASR宸插紑婧恟untime-SDK銆�
-闆嗘垚浜嗚揪鎽╅櫌璇煶瀹為獙瀹ゅ湪Modelscope绀惧尯寮�婧愮殑璇煶绔偣妫�娴�(VAD)銆丳araformer-large璇煶璇嗗埆(ASR)銆佹爣鐐规仮澶�(PUNC) 绛夌浉鍏宠兘鍔涳紝鎷ユ湁瀹屾暣鐨勮闊宠瘑鍒摼璺紝鍙互灏嗗嚑鍗佷釜灏忔椂鐨勯煶棰戣瘑鍒垚甯︽爣鐐圭殑鏂囧瓧锛岃�屼笖鏀寔涓婄櫨璺苟鍙戝悓鏃惰繘琛岃瘑鍒��
+闆嗘垚浜嗚揪鎽╅櫌璇煶瀹為獙瀹ゅ湪Modelscope绀惧尯寮�婧愮殑璇煶绔偣妫�娴�(VAD)銆丳araformer-large璇煶璇嗗埆(ASR)銆佹爣鐐规仮澶�(PUNC) 绛夌浉鍏宠兘鍔涳紝鎷ユ湁瀹屾暣鐨勮闊宠瘑鍒摼璺紝鍙互灏嗗嚑鍗佷釜灏忔椂鐨勯煶棰戞垨瑙嗛璇嗗埆鎴愬甫鏍囩偣鐨勬枃瀛楋紝鑰屼笖鏀寔涓婄櫨璺姹傚悓鏃惰繘琛岃浆鍐欍��
 
 ## 鏈嶅姟鍣ㄩ厤缃�
 
@@ -10,25 +10,31 @@
 - 閰嶇疆2: 锛圶86锛岃绠楀瀷锛夛紝16鏍竩CPU锛屽唴瀛�32G锛屽崟鏈哄彲浠ユ敮鎸佸ぇ绾�64璺殑璇锋眰
 - 閰嶇疆3: 锛圶86锛岃绠楀瀷锛夛紝64鏍竩CPU锛屽唴瀛�128G锛屽崟鏈哄彲浠ユ敮鎸佸ぇ绾�200璺殑璇锋眰
 
+璇︾粏鎬ц兘娴嬭瘯鎶ュ憡锛圼鐐瑰嚮姝ゅ](./benchmark_onnx_cpp.md)锛�
+
 浜戞湇鍔″巶鍟嗭紝閽堝鏂扮敤鎴凤紝鏈�3涓湀鍏嶈垂璇曠敤娲诲姩锛岀敵璇锋暀绋嬶紙[鐐瑰嚮姝ゅ](./aliyun_server_tutorial.md)锛�
 
 ## 蹇�熶笂鎵�
 
 ### 鏈嶅姟绔惎鍔�
 
-灏嗕笅闈㈡寚浠ゆ嫹璐濊嚦缁堢杩愯锛屽湪鎻愮ず澶勮緭鍏ュ洖杞﹂敭鍗冲彲瀹屾垚鏈嶅姟绔畨瑁呬笌閮ㄧ讲銆傜洰鍓嶄究鎹烽儴缃插伐鍏锋殏鏃朵粎鏀寔Linux鐜锛屽叾浠栫幆澧冮儴缃插弬鑰冨紑鍙戞寚鍗楋紙[鐐瑰嚮姝ゅ](./SDK_advanced_guide_cn.md)锛�
+涓嬭浇閮ㄧ讲宸ュ叿`funasr-runtime-deploy-offline-cpu-zh.sh`
 
 ```shell
-curl -O https://raw.githubusercontent.com/alibaba-damo-academy/FunASR/main/funasr/runtime/deploy_tools/funasr-runtime-deploy-offline-cpu-zh.sh; \
-sudo bash funasr-runtime-deploy-offline-cpu-zh.sh install --workspace /root/funasr-runtime-sdk
+curl -O https://raw.githubusercontent.com/alibaba-damo-academy/FunASR/main/funasr/runtime/deploy_tools/funasr-runtime-deploy-offline-cpu-zh.sh;
 # 濡傞亣鍒扮綉缁滈棶棰橈紝涓浗澶ч檰鐢ㄦ埛锛屽彲浠ョ敤涓笅闈㈢殑鍛戒护锛�
-# curl -O https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/shell/funasr-runtime-deploy-offline-cpu-zh.sh; sudo bash funasr-runtime-deploy-offline-cpu-zh install --workspace /root/funasr-runtime-sdk
+# curl -O https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/shell/funasr-runtime-deploy-offline-cpu-zh.sh;
+```
+
+鎵ц閮ㄧ讲宸ュ叿锛屽湪鎻愮ず澶勮緭鍏ュ洖杞﹂敭鍗冲彲瀹屾垚鏈嶅姟绔畨瑁呬笌閮ㄧ讲銆傜洰鍓嶄究鎹烽儴缃插伐鍏锋殏鏃朵粎鏀寔Linux鐜锛屽叾浠栫幆澧冮儴缃插弬鑰冨紑鍙戞寚鍗楋紙[鐐瑰嚮姝ゅ](./SDK_advanced_guide_offline_zh.md)锛�
+```shell
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh install --workspace /root/funasr-runtime-resources
 ```
 
 ### 瀹㈡埛绔祴璇曚笌浣跨敤
 
-杩愯涓婇潰瀹夎鎸囦护鍚庯紝浼氬湪/root/funasr-runtime-sdk锛堥粯璁ゅ畨瑁呯洰褰曪級涓笅杞藉鎴风娴嬭瘯宸ュ叿鐩綍funasr_samples锛�
-鎴戜滑浠ython璇█瀹㈡埛绔负渚嬶紝杩涜璇存槑锛屾敮鎸佸绉嶉煶棰戞牸寮忚緭鍏ワ紙.wav, .pcm, .mp3绛夛級锛屼篃鏀寔瑙嗛杈撳叆(.mp4绛�)锛屼互鍙婂鏂囦欢鍒楄〃wav.scp杈撳叆锛屽叾浠栫増鏈鎴风璇峰弬鑰冩枃妗o紙[鐐瑰嚮姝ゅ](##瀹㈡埛绔敤娉曡瑙�)锛�
+杩愯涓婇潰瀹夎鎸囦护鍚庯紝浼氬湪/root/funasr-runtime-resources锛堥粯璁ゅ畨瑁呯洰褰曪級涓笅杞藉鎴风娴嬭瘯宸ュ叿鐩綍samples锛�
+鎴戜滑浠ython璇█瀹㈡埛绔负渚嬶紝杩涜璇存槑锛屾敮鎸佸绉嶉煶棰戞牸寮忚緭鍏ワ紙.wav, .pcm, .mp3绛夛級锛屼篃鏀寔瑙嗛杈撳叆(.mp4绛�)锛屼互鍙婂鏂囦欢鍒楄〃wav.scp杈撳叆锛屽叾浠栫増鏈鎴风璇峰弬鑰冩枃妗o紙[鐐瑰嚮姝ゅ](#瀹㈡埛绔敤娉曡瑙�)锛�
 
 ```shell
 python3 wss_client_asr.py --host "127.0.0.1" --port 10095 --mode offline --audio_in "../audio/asr_example.wav" --output_dir "./results"
@@ -39,10 +45,10 @@
 鍦ㄦ湇鍔″櫒涓婂畬鎴怓unASR鏈嶅姟閮ㄧ讲浠ュ悗锛屽彲浠ラ�氳繃濡備笅鐨勬楠ゆ潵娴嬭瘯鍜屼娇鐢ㄧ绾挎枃浠惰浆鍐欐湇鍔°��
 鐩墠鍒嗗埆鏀寔浠ヤ笅鍑犵缂栫▼璇█瀹㈡埛绔�
 
-- [Python](###python-client)
-- [CPP](###cpp-client)
-- [Java]()
-- [html缃戦〉鐗堟湰]()
+- [Python](#python-client)
+- [CPP](#cpp-client)
+- [html缃戦〉鐗堟湰](#Html缃戦〉鐗�)
+- [Java](#Java-client)
 
 鏇村鐗堟湰瀹㈡埛绔敮鎸佽鍙傝�僛寮�鍙戞寚鍗梋(./SDK_advanced_guide_offline_zh.md)
 
@@ -63,10 +69,9 @@
 ```
 
 ### cpp-client
-
+杩涘叆samples/cpp鐩綍鍚庯紝鍙互鐢╟pp杩涜娴嬭瘯锛屾寚浠ゅ涓嬶細
 ```shell
-export LD_LIBRARY_PATH=/root/funasr_samples/cpp/libs:$LD_LIBRARY_PATH
-/root/funasr_samples/cpp/funasr-wss-client --server-ip 127.0.0.1 --port 10095 --wav-path /root/funasr_samples/audio/asr_example.wav
+./funasr-wss-client --server-ip 127.0.0.1 --port 10095 --wav-path ../audio/asr_example.wav
 ```
 
 鍛戒护鍙傛暟璇存槑锛�
@@ -76,6 +81,19 @@
 --port 10095 閮ㄧ讲绔彛鍙�
 --wav-path 闇�瑕佽繘琛岃浆鍐欑殑闊抽鏂囦欢锛屾敮鎸佹枃浠惰矾寰�
 ```
+
+### Html缃戦〉鐗�
+
+鍦ㄦ祻瑙堝櫒涓墦寮� html/static/index.html锛屽嵆鍙嚭鐜板涓嬮〉闈紝鏀寔楹﹀厠椋庤緭鍏ヤ笌鏂囦欢涓婁紶锛岀洿鎺ヨ繘琛屼綋楠�
+
+<img src="images/html.png"  width="900"/>
+
+### Java-client
+
+```shell
+FunasrWsClient --host localhost --port 10095 --audio_in ./asr_example.wav --mode offline
+```
+璇︾粏鍙互鍙傝�冩枃妗o紙[鐐瑰嚮姝ゅ](../java/readme.md)锛�
 
 ## 鏈嶅姟绔敤娉曡瑙�
 
@@ -104,10 +122,10 @@
 鏇挎崲姝e湪浣跨敤鐨勬ā鍨嬶紝骞堕噸鏂板惎鍔‵unASR鏈嶅姟銆傛ā鍨嬮渶涓篗odelScope涓殑ASR/VAD/PUNC妯″瀷锛屾垨鑰呬粠ModelScope涓ā鍨媐inetune鍚庣殑妯″瀷銆�
 
 ```shell
-sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [asr_model | vad_model | punc_model] <model_id or local model path>
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [--asr_model | --vad_model | --punc_model] <model_id or local model path>
 
 e.g
-sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update asr_model damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update --asr_model damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch
 ```
 
 ### 鏇存柊鍙傛暟骞堕噸鍚疐unASR鏈嶅姟
@@ -115,36 +133,28 @@
 鏇存柊宸查厤缃弬鏁帮紝骞堕噸鏂板惎鍔‵unASR鏈嶅姟鐢熸晥銆傚彲鏇存柊鍙傛暟鍖呮嫭瀹夸富鏈哄拰Docker鐨勭鍙e彿锛屼互鍙婃帹鐞嗗拰IO鐨勭嚎绋嬫暟閲忋��
 
 ```shell
-sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [host_port | docker_port] <port number>
-sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [decode_thread_num | io_thread_num] <the number of threads>
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [--host_port | --docker_port] <port number>
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [--decode_thread_num | --io_thread_num] <the number of threads>
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update [--workspace] <workspace in local>
 
 e.g
-sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update decode_thread_num 32
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update --decode_thread_num 32
+sudo bash funasr-runtime-deploy-offline-cpu-zh.sh update --workspace /root/funasr-runtime-resources
 ```
 
 
 ## 鏈嶅姟绔惎鍔ㄨ繃绋嬮厤缃瑙�
 
-##### 璁剧疆瀹夸富鏈虹殑宸ヤ綔绌洪棿璺緞
-榛樿灏嗗湪鎿嶄綔鐩綍涓嬪垱寤篺unasr-runtime-sdk浣滀负宸ヤ綔绌洪棿璺緞
-```text
-[1/6]
-  Please enter the local path of workspace.
-  Setting the local path of workspace, default(/root/funasr-runtime-sdk): 
-  The local workspace path is /root/funasr-runtime-sdk .
-  The models will store in local path(/root/funasr-runtime-sdk/models) during the run.
-```
-
 ##### 閫夋嫨FunASR Docker闀滃儚
 鎺ㄨ崘閫夋嫨1)浣跨敤鎴戜滑鐨勬渶鏂板彂甯冪増闀滃儚锛屼篃鍙�夋嫨鍘嗗彶鐗堟湰銆�
 ```text
-[2/6]
+[1/5]
   Getting the list of docker images, please wait a few seconds.
     [DONE]
 
   Please choose the Docker image.
     1) registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-cpu-0.1.0
-  Enter your choice, default(1): 
+  Enter your choice, default(1):
   You have chosen the Docker image: registry.cn-hangzhou.aliyuncs.com/funasr_repo/funasr:funasr-runtime-sdk-cpu-0.1.0
 ```
 
@@ -152,9 +162,9 @@
 ##### 璁剧疆瀹夸富鏈烘彁渚涚粰FunASR鐨勭鍙�
 璁剧疆鎻愪緵缁橠ocker鐨勫涓绘満绔彛锛岄粯璁や负10095銆傝淇濊瘉姝ょ鍙e彲鐢ㄣ��
 ```text
-[3/6]
+[2/5]
   Please input the opened port in the host used for FunASR server.
-  Setting the opened host port [1-65535], default(10095): 
+  Setting the opened host port [1-65535], default(10095):
   The port of the host is 10095
   The port in Docker for FunASR server is 10095
 ```

--
Gitblit v1.9.1