mirror of
https://github.com/modelscope/FunASR
synced 2025-09-15 14:48:36 +08:00
Merge pull request #855 from alibaba-damo-academy/dev_onnx
Contextual Paraformer onnx export
This commit is contained in:
commit
0dd01a880b
@ -5,6 +5,7 @@ model_dir = "./export/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-
|
||||
model = ContextualParaformer(model_dir, batch_size=1)
|
||||
|
||||
wav_path = ['{}/.cache/modelscope/hub/damo/speech_paraformer-large-contextual_asr_nat-zh-cn-16k-common-vocab8404/example/asr_example.wav'.format(Path.home())]
|
||||
|
||||
hotwords = '随机热词 各种热词 魔搭 阿里巴巴 仏'
|
||||
|
||||
result = model(wav_path, hotwords)
|
||||
|
||||
@ -241,14 +241,6 @@ class ContextualParaformer(Paraformer):
|
||||
):
|
||||
|
||||
if not Path(model_dir).exists():
|
||||
try:
|
||||
from modelscope.hub.snapshot_download import snapshot_download
|
||||
except:
|
||||
raise "You are exporting model from modelscope, please install modelscope and try it again. To install modelscope, you could:\n" \
|
||||
"\npip3 install -U modelscope\n" \
|
||||
"For the users in China, you could install with the command:\n" \
|
||||
"\npip3 install -U modelscope -i https://mirror.sjtu.edu.cn/pypi/web/simple"
|
||||
|
||||
try:
|
||||
model_dir = snapshot_download(model_dir, cache_dir=cache_dir)
|
||||
except:
|
||||
|
||||
Loading…
Reference in New Issue
Block a user