From 2e36e738ca39afc8d02f3d11013bd12f937cc874 Mon Sep 17 00:00:00 2001
From: zhaomingwork <61895407+zhaomingwork@users.noreply.github.com>
Date: 星期三, 08 十一月 2023 09:22:06 +0800
Subject: [PATCH] fix bug for h5 hotwords (#1067)

---
 egs_modelscope/asr/TEMPLATE/README_zh.md |   29 ++++++++++++++++++++++++++++-
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/egs_modelscope/asr/TEMPLATE/README_zh.md b/egs_modelscope/asr/TEMPLATE/README_zh.md
index 47656b3..0754bc6 100644
--- a/egs_modelscope/asr/TEMPLATE/README_zh.md
+++ b/egs_modelscope/asr/TEMPLATE/README_zh.md
@@ -21,6 +21,33 @@
 rec_result = inference_pipeline(audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/asr_example_zh.wav')
 print(rec_result)
 ```
+#### [Paraformer闀块煶棰戞ā鍨媇(https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-pytorch/summary)
+```python
+from modelscope.pipelines import pipeline
+from modelscope.utils.constant import Tasks
+
+inference_pipeline = pipeline(
+    task=Tasks.auto_speech_recognition,
+    model='damo/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch',
+    vad_model='damo/speech_fsmn_vad_zh-cn-16k-common-pytorch',
+    #punc_model='damo/punc_ct-transformer_zh-cn-common-vocab272727-pytorch',
+    punc_model='damo/punc_ct-transformer_cn-en-common-vocab471067-large',
+)
+
+rec_result = inference_pipeline(audio_in='https://isv-data.oss-cn-hangzhou.aliyuncs.com/ics/MaaS/ASR/test_audio/vad_example.wav', 
+                                batch_size_token=5000, batch_size_token_threshold_s=40, max_single_segment_time=6000)
+print(rec_result)
+```
+鍏朵腑锛� 
+- `batch_size_token` 琛ㄧず閲囩敤鍔ㄦ�乥atch锛宐atch涓�籺oken鏁颁负 `batch_size_token`锛�1 token = 60 ms. 
+- `batch_size_token_threshold_s`: 琛ㄧず闊抽鏃堕暱瓒呰繃 `batch_size_token_threshold_s`闃堝�兼槸锛宐atch鏁拌缃负1, 鍗曚綅涓簊.
+- `max_single_segment_time`: 琛ㄧずVAD鏈�澶у垏鍓查煶棰戞椂闀�, 鍗曚綅鏄痬s.
+
+寤鸿锛氬綋鎮ㄨ緭鍏ヤ负闀块煶棰戯紝閬囧埌OOM闂鏃讹紝鍥犱负鏄惧瓨鍗犵敤涓庨煶棰戞椂闀垮憟骞虫柟鍏崇郴澧炲姞锛屽垎涓�3绉嶆儏鍐碉細
+- a)鎺ㄧ悊璧峰闃舵锛屾樉瀛樹富瑕佸彇鍐充簬`batch_size_token`锛岄�傚綋鍑忓皬璇ュ�硷紝鍙互鍑忓皯鏄惧瓨鍗犵敤锛�
+- b)鎺ㄧ悊涓棿闃舵锛岄亣鍒癡AD鍒囧壊鐨勯暱闊抽鐗囨锛屾�籺oken鏁板皬浜巂batch_size_token`锛屼粛鐒跺嚭鐜癘OM锛屽彲浠ラ�傚綋鍑忓皬`batch_size_token_threshold_s`锛岃秴杩囬槇鍊硷紝寮哄埗batch涓�1; 
+- c)鎺ㄧ悊蹇粨鏉熼樁娈碉紝閬囧埌VAD鍒囧壊鐨勯暱闊抽鐗囨锛屾�籺oken鏁板皬浜巂batch_size_token`锛屼笖瓒呰繃闃堝�糮batch_size_token_threshold_s`锛屽己鍒禸atch涓�1锛屼粛鐒跺嚭鐜癘OM锛屽彲浠ラ�傚綋鍑忓皬`max_single_segment_time`锛屼娇寰梀AD鍒囧壊闊抽鏃堕暱鍙樼煭銆�
+
 #### [Paraformer-瀹炴椂妯″瀷](https://www.modelscope.cn/models/damo/speech_paraformer-large_asr_nat-zh-cn-16k-common-vocab8404-online/summary)
 ##### 瀹炴椂鎺ㄧ悊
 ```python
@@ -68,7 +95,7 @@
 ```
 婕旂ず浠g爜瀹屾暣鐗堟湰锛岃鍙傝�僛demo](https://github.com/alibaba-damo-academy/FunASR/discussions/241)
 
-#### [Paraformer-contextual Model](https://www.modelscope.cn/models/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404/summary)
+#### [Paraformer-contextual 鐑瘝妯″瀷](https://www.modelscope.cn/models/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404/summary)
 ```python
 from modelscope.pipelines import pipeline
 from modelscope.utils.constant import Tasks

--
Gitblit v1.9.1