From 4ace5a95b052d338947fc88809a440ccd55cf6b4 Mon Sep 17 00:00:00 2001 From: 游雁 <zhifu.gzf@alibaba-inc.com> Date: 星期四, 16 十一月 2023 16:39:52 +0800 Subject: [PATCH] funasr pages --- egs_modelscope/asr/TEMPLATE/README_zh.md | 27 ++++++++++++++++++++++++++- 1 files changed, 26 insertions(+), 1 deletions(-) diff --git a/egs_modelscope/asr/TEMPLATE/README_zh.md b/egs_modelscope/asr/TEMPLATE/README_zh.md index 47656b3..583e63a 100644 --- a/egs_modelscope/asr/TEMPLATE/README_zh.md +++ b/egs_modelscope/asr/TEMPLATE/README_zh.md @@ -21,6 +21,31 @@ 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_cn-en-common-vocab471067-large', +) + +rec_result = inference_pipeline(audio_in='./vad_example.wav') +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 +93,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