modelscope / FunASR

A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
https://www.funasr.com
Other
4.55k stars 504 forks source link

automodel推理 #1872

Open wwfcnu opened 2 days ago

wwfcnu commented 2 days ago
from funasr import AutoModel
# paraformer-zh is a multi-functional asr model
# use vad, punc, spk or not as you need
model = AutoModel(model="paraformer-zh",  vad_model="fsmn-vad",  punc_model="ct-punc", 
                  # spk_model="cam++", 
                  )
res = model.generate(input=f"{model.model_path}/example/asr_example.wav", 
                     batch_size_s=300, 
                     hotword='魔搭')
print(res)

model的vad和punc是默认开启的吧,如果我不要vad,punc_model,怎么设置参数,写成下面这样吗 model =AutoModel(model="paraformer-zh", vad_model="", punc_model="")

wwfcnu commented 2 days ago

另外就是我想改动batch_size=64,修改哪个参数

image

batch_size_s=300和batch_size是啥关系

wwfcnu commented 2 days ago

我推理的时候,显存不断增加,然后过一段时间就oom了,我设置的batch_size很小,数据也是10s左右的。