From bf7c451a7ddf756b400b08f7b669173542381f69 Mon Sep 17 00:00:00 2001
From: 游雁 <zhifu.gzf@alibaba-inc.com>
Date: 星期四, 13 七月 2023 17:35:13 +0800
Subject: [PATCH] html5 docs
---
/dev/null | 135 ---------------------------------
funasr/runtime/html5/readme.md | 2
funasr/runtime/html5/readme_zh.md | 94 +++++++++++++++++++++++
3 files changed, 96 insertions(+), 135 deletions(-)
diff --git a/funasr/runtime/html5/readme.md b/funasr/runtime/html5/readme.md
index c85641c..e46ab92 100644
--- a/funasr/runtime/html5/readme.md
+++ b/funasr/runtime/html5/readme.md
@@ -1,3 +1,5 @@
+([绠�浣撲腑鏂嘳(./readme_zh.md)|English)
+
# Html5 server for asr service
## Requirement
diff --git a/funasr/runtime/html5/readme_cn.md b/funasr/runtime/html5/readme_cn.md
deleted file mode 100644
index dfc27c9..0000000
--- a/funasr/runtime/html5/readme_cn.md
+++ /dev/null
@@ -1,135 +0,0 @@
-# Html5 server for asr service
-
-## Requirement
-#### Install the modelscope and funasr
-```shell
-pip install -U modelscope funasr
-# For the users in China, you could install with the command:
-# pip install -U modelscope funasr -i https://mirror.sjtu.edu.cn/pypi/web/simple
-git clone https://github.com/alibaba/FunASR.git && cd FunASR
-```
-#### Install the requirements for server
-```shell
-pip install flask
-# pip install gevent (Optional)
-# pip install pyOpenSSL (Optional)
-```
-
-### javascript (Optional)
-[html5褰曢煶](https://github.com/xiangyuecn/Recorder)
-```shell
-Recorder
-```
-
-## demo椤甸潰濡備笅
-<div align="center"><img src="./demo.gif" width="150"/> </div>
-
-[//]: # (## 涓ょws_server杩炴帴妯″紡)
-
-[//]: # (### 1)鐩存帴杩炴帴妯″紡锛屾祻瑙堝櫒https楹﹀厠椋� --> html5 demo鏈嶅姟 --> js wss鎺ュ彛 --> wss asr online srv(璇佷功鐢熸垚璇峰線鍚庣湅))
-
-[//]: # (### 2)nginx涓浆锛屾祻瑙堝櫒https楹﹀厠椋� --> html5 demo鏈嶅姟 --> js wss鎺ュ彛 --> nginx鏈嶅姟 --> ws asr online srv)
-
-## 鎿嶄綔姝ラ
-### html5 demo鏈嶅姟鍚姩
-鍚姩html5鏈嶅姟锛岄渶瑕乻sl璇佷功(宸茬敓鎴愶紝濡傞渶瑕佽嚜宸辩敓鎴愯寰�鍚庣湅)
-```shell
-h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE]
-```
-渚嬪瓙濡備笅锛岄渶瑕佹敞鎰廼p鍦板潃锛屽鏋滀粠鍏朵粬璁惧璁块棶闇�姹傦紙渚嬪鎵嬫満绔級锛岄渶瑕佸皢ip鍦板潃璁句负鐪熷疄ip
-```shell
-cd funasr/runtime/html5
-python h5Server.py --host 0.0.0.0 --port 1337
-# python h5Server.py --host 30.220.136.139 --port 1337
-```
-### 鍚姩ASR鏈嶅姟
-[鍏蜂綋璇风湅online asr](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket)
-
-`Tips:` asr 鏈嶅姟闇�瑕佷笌html5鏈嶅姟閮ㄧ讲鍒板悓涓�涓墿鐞嗘満鍣ㄤ笂
-#### wss鏂瑰紡
-```shell
-cd ../python/websocket
-python funasr_wss_server.py --port 10095
-```
-
-### 娴忚鍣ㄦ墦寮�鍦板潃
-ip鍦板潃闇�瑕佷笌html5 server淇濇寔涓�鑷达紝濡傛灉鏄湰鍦版満鍣紝鍙互鐢�127.0.0.1
-```shell
-https://127.0.0.1:1337/static/index.html
-# https://30.220.136.139:1337/static/index.html
-```
-
-### 淇敼缃戦〉閲宎sr鎺ュ彛鍦板潃
-淇敼缃戦〉涓紝asr鏈嶅姟鍣ㄥ湴鍧�锛坵ebsocket srv鐨刬p涓庣鍙o級锛岀偣鍑诲紑濮嬪嵆鍙娇鐢ㄣ�傛敞鎰廻5鏈嶅姟鍜宎sr鏈嶅姟闇�瑕佸湪鍚屼竴涓湇鍔″櫒涓婏紝鍚﹀垯瀛樺湪璺ㄥ煙闂銆�
-
-
-
-[//]: # (## nginx閰嶇疆璇存槑(浜嗚В鐨勫彲浠ヨ烦杩�))
-
-[//]: # (h5鎵撳紑楹﹀厠椋庨渶瑕乭ttps鍗忚锛屽悓鏃跺悗绔殑asr websocket涔熷繀椤绘槸wss鍗忚锛屽鏋淸online asr](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket)浠s鏂瑰紡杩愯锛屾垜浠彲浠ラ�氳繃nginx閰嶇疆瀹炵幇wss鍗忚鍒皐s鍗忚鐨勮浆鎹€��)
-
-[//]: # ()
-[//]: # (### nginx杞彂閰嶇疆绀轰緥)
-
-[//]: # (```shell)
-
-[//]: # (events { [0/1548])
-
-[//]: # ( worker_connections 1024;)
-
-[//]: # ( accept_mutex on;)
-
-[//]: # ( })
-
-[//]: # (http {)
-
-[//]: # ( error_log error.log;)
-
-[//]: # ( access_log access.log;)
-
-[//]: # ( server {)
-
-[//]: # ()
-[//]: # ( listen 5921 ssl http2; # nginx listen port for wss)
-
-[//]: # ( server_name www.test.com;)
-
-[//]: # ()
-[//]: # ( ssl_certificate /funasr/server.crt;)
-
-[//]: # ( ssl_certificate_key /funasr/server.key;)
-
-[//]: # ( ssl_protocols TLSv1 TLSv1.1 TLSv1.2;)
-
-[//]: # ( ssl_ciphers HIGH:!aNULL:!MD5;)
-
-[//]: # ()
-[//]: # ( location /wss/ {)
-
-[//]: # ()
-[//]: # ()
-[//]: # ( proxy_pass http://127.0.0.1:1111/; # asr online model ws address and port)
-
-[//]: # ( proxy_http_version 1.1;)
-
-[//]: # ( proxy_set_header Upgrade $http_upgrade;)
-
-[//]: # ( proxy_set_header Connection "upgrade";)
-
-[//]: # ( proxy_read_timeout 600s;)
-
-[//]: # ()
-[//]: # ( })
-
-[//]: # ( })
-
-[//]: # (```)
-
-[//]: # (### 淇敼wsconnecter.js閲宎sr鎺ュ彛鍦板潃)
-
-[//]: # (wsconnecter.js閲岄厤缃畂nline asr鏈嶅姟鍦板潃璺緞锛岃繖閲岄厤缃殑鏄痺ss绔彛)
-
-[//]: # (var Uri = "wss://xxx:xxx/wss/" )
-## Acknowledge
-1. This project is maintained by [FunASR community](https://github.com/alibaba-damo-academy/FunASR).
-2. We acknowledge [AiHealthx](http://www.aihealthx.com/) for contributing the html5 demo.
\ No newline at end of file
diff --git a/funasr/runtime/html5/readme_zh.md b/funasr/runtime/html5/readme_zh.md
new file mode 100644
index 0000000..a820758
--- /dev/null
+++ b/funasr/runtime/html5/readme_zh.md
@@ -0,0 +1,94 @@
+(绠�浣撲腑鏂噟[English](./readme.md))
+
+# 璇煶璇嗗埆鏈嶅姟Html5瀹㈡埛绔闂晫闈�
+
+鏈嶅姟绔儴缃查噰鐢╳ebsocket鍗忚锛屽鎴风鍙互鏀寔html5缃戦〉璁块棶锛屾敮鎸侀害鍏嬮杈撳叆涓庢枃浠惰緭鍏ワ紝鍙互閫氳繃濡備笅2绉嶆柟寮忚闂細
+- 鏂瑰紡涓�锛�
+
+ html瀹㈡埛绔洿杩烇紝鎵嬪姩涓嬭浇瀹㈡埛绔紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/html5/static)锛夎嚦鏈湴锛屾墦寮�`index.html`缃戦〉锛岃緭鍏ss鍦板潃涓庣鍙e彿
+
+- 鏂瑰紡浜岋細
+
+ html5鏈嶅姟绔紝鑷姩涓嬭浇瀹㈡埛绔嚦鏈湴锛屾敮鎸佹墜鏈虹瓑绔笂璁块棶
+
+## 璇煶璇嗗埆鏈嶅姟鍚姩
+
+鏀寔python鐗堟湰涓巆++鐗堟湰鏈嶅姟閮ㄧ讲锛屽叾涓�
+
+- python鐗堟湰
+
+ 鐩存帴閮ㄧ讲python pipeline锛屾敮鎸佹祦寮忓疄鏃惰闊宠瘑鍒ā鍨嬶紝绂荤嚎璇煶璇嗗埆妯″瀷锛屾祦寮忕绾夸竴浣撳寲绾犻敊妯″瀷锛岃緭鍑哄緟鏍囩偣鏂囧瓧銆傚崟涓猻erver锛屾敮鎸佸崟涓猚lient銆�
+
+- c++鐗堟湰
+
+ funasr-runtime-sdk锛屾敮鎸佷竴閿儴缃诧紝0.1.0鐗堟湰锛屾敮鎸佺绾挎枃浠惰浆鍐欍�傚崟涓猻erver锛屾敮鎸佷笂鐧捐矾client璇锋眰銆�
+
+### python鐗堟湰鏈嶅姟鍚姩
+
+#### 瀹夎渚濊禆鐜
+
+```shell
+pip3 install -U modelscope funasr flask
+# 涓浗澶ч檰鐢ㄦ埛锛屽鏋滈亣鍒扮綉缁滈棶棰橈紝鍙互閫氳繃涓嬮潰鎸囦护瀹夎锛�
+# pip3 install -U modelscope funasr -i https://mirror.sjtu.edu.cn/pypi/web/simple
+git clone https://github.com/alibaba/FunASR.git && cd FunASR
+```
+
+#### 鍚姩ASR鏈嶅姟
+
+#### wss鏂瑰紡
+
+```shell
+cd funasr/runtime/python/websocket
+python funasr_wss_server.py --port 10095
+```
+
+璇︾粏鍙傛暟閰嶇疆涓庤В鏋愶紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/python/websocket)锛�
+
+#### html5鏈嶅姟锛堝彲閫夛級
+
+濡傛灉闇�瑕佷娇鐢ㄤ笂闈㈡墍璇寸殑瀹㈡埛绔柟寮忎簩锛岃繘琛岃闂紝鍙互鍚姩html5鏈嶅姟
+```shell
+h5Server.py [-h] [--host HOST] [--port PORT] [--certfile CERTFILE] [--keyfile KEYFILE]
+```
+渚嬪瓙濡備笅锛岄渶瑕佹敞鎰廼p鍦板潃锛屽鏋滀粠鍏朵粬璁惧璁块棶闇�姹傦紙渚嬪鎵嬫満绔級锛岄渶瑕佸皢ip鍦板潃璁句负鐪熷疄鍏綉ip
+```shell
+cd funasr/runtime/html5
+python h5Server.py --host 0.0.0.0 --port 1337
+# python h5Server.py --host 30.220.136.139 --port 1337
+```
+
+鍚姩鍚庯紝鍦ㄦ祻瑙堝櫒涓緭鍏ワ紙https://127.0.0.1:1337/static/index.html锛夊嵆鍙闂�
+
+### c++ 鐗堟湰鏈嶅姟鍚姩
+
+鐢变簬c++渚濊禆鐜杈冨锛屽缓璁噰鐢╠ocker閮ㄧ讲锛屾敮鎸佷竴閿惎鍔ㄦ湇鍔�
+
+```shell
+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.sh install --workspace /root/funasr-runtime-resources
+```
+璇︾粏鍙傛暟閰嶇疆涓庤В鏋愶紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/blob/main/funasr/runtime/docs/SDK_tutorial_zh.md)锛�
+
+
+## 瀹㈡埛绔祴璇�
+
+### 鏂瑰紡涓�
+
+html瀹㈡埛绔洿杩烇紝鎵嬪姩涓嬭浇瀹㈡埛绔紙[鐐瑰嚮姝ゅ](https://github.com/alibaba-damo-academy/FunASR/tree/main/funasr/runtime/html5/static)锛夎嚦鏈湴锛屾墦寮�`index.html`缃戦〉锛岃緭鍏ss鍦板潃涓庣鍙e彿鍗冲彲浣跨敤
+
+### 鏂瑰紡浜�
+
+html5鏈嶅姟绔紝鑷姩涓嬭浇瀹㈡埛绔嚦鏈湴锛屾敮鎸佹墜鏈虹瓑绔笂璁块棶锛宨p鍦板潃闇�瑕佷笌html5 server淇濇寔涓�鑷达紝濡傛灉鏄湰鍦版満鍣紝鍙互鐢�127.0.0.1
+
+
+```shell
+https://127.0.0.1:1337/static/index.html
+```
+
+杈撳叆wss鍦板潃涓庣鍙e彿鍗冲彲浣跨敤
+
+
+## Acknowledge
+1. This project is maintained by [FunASR community](https://github.com/alibaba-damo-academy/FunASR).
+2. We acknowledge [AiHealthx](http://www.aihealthx.com/) for contributing the html5 demo.
\ No newline at end of file
--
Gitblit v1.9.1