A Fundamental End-to-End Speech Recognition Toolkit and Open Source SOTA Pretrained Models, Supporting Speech Recognition, Voice Activity Detection, Text Post-processing etc.
from funasr import AutoModel
model = AutoModel(model='iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch',
model_revision="v2.0.4",
vad_model='iic/speech_fsmn_vad_zh-cn-16k-common-pytorch',
vad_model_revision="v2.0.4",
punc_model='iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch',
punc_model_revision="v2.0.4",
spk_model="cam++", spk_model_revision="v2.0.2",
disable_update=True
)
res = model.generate(input='test.wav',
batch_size_s=1,
hotword='魔搭')
print(res)
报错
Key Conformer already exists in model_classes, re-register
Key Linear already exists in adaptor_classes, re-register
Key TransformerDecoder already exists in decoder_classes, re-register
Key LightweightConvolutionTransformerDecoder already exists in decoder_classes, re-register
Key LightweightConvolution2DTransformerDecoder already exists in decoder_classes, re-register
Key DynamicConvolutionTransformerDecoder already exists in decoder_classes, re-register
Key DynamicConvolution2DTransformerDecoder already exists in decoder_classes, re-register
funasr version: 1.1.14.
Downloading Model to directory: /home/ 1/.cache/modelscope/hub/iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch
2024-11-14 14:36:42,695 - modelscope - INFO - Use user-specified model revision: v2.0.4
Downloading Model to directory: /home/1/.cache/modelscope/hub/iic/speech_fsmn_vad_zh-cn-16k-common-pytorch
2024-11-14 14:36:57,908 - modelscope - INFO - Use user-specified model revision: v2.0.4
Downloading Model to directory: /home/1/.cache/modelscope/hub/iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch
2024-11-14 14:36:59,037 - modelscope - INFO - Use user-specified model revision: v2.0.4
Downloading [configuration.json]: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 373/373 [00:00<00:00, 529B/s]
0%|
尝试使用paraformer时,出现如题所示报错
代码
from funasr import AutoModel model = AutoModel(model='iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch', model_revision="v2.0.4", vad_model='iic/speech_fsmn_vad_zh-cn-16k-common-pytorch', vad_model_revision="v2.0.4", punc_model='iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch', punc_model_revision="v2.0.4",
spk_model="cam++", spk_model_revision="v2.0.2",
res = model.generate(input='test.wav', batch_size_s=1, hotword='魔搭') print(res)
报错
Key Conformer already exists in model_classes, re-register Key Linear already exists in adaptor_classes, re-register Key TransformerDecoder already exists in decoder_classes, re-register Key LightweightConvolutionTransformerDecoder already exists in decoder_classes, re-register Key LightweightConvolution2DTransformerDecoder already exists in decoder_classes, re-register Key DynamicConvolutionTransformerDecoder already exists in decoder_classes, re-register Key DynamicConvolution2DTransformerDecoder already exists in decoder_classes, re-register funasr version: 1.1.14. Downloading Model to directory: /home/ 1/.cache/modelscope/hub/iic/speech_paraformer-large-vad-punc_asr_nat-zh-cn-16k-common-vocab8404-pytorch 2024-11-14 14:36:42,695 - modelscope - INFO - Use user-specified model revision: v2.0.4 Downloading Model to directory: /home/1/.cache/modelscope/hub/iic/speech_fsmn_vad_zh-cn-16k-common-pytorch 2024-11-14 14:36:57,908 - modelscope - INFO - Use user-specified model revision: v2.0.4 Downloading Model to directory: /home/1/.cache/modelscope/hub/iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch 2024-11-14 14:36:59,037 - modelscope - INFO - Use user-specified model revision: v2.0.4 Downloading [configuration.json]: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 373/373 [00:00<00:00, 529B/s] 0%|
我的环境
操作系统: No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 20.04.6 LTS Release: 20.04 Codename: focal 安装的包: addict 2.4.0 aiohappyeyeballs 2.4.3 aiohttp 3.11.0 aiosignal 1.3.1 aliyun-python-sdk-core 2.16.0 aliyun-python-sdk-kms 2.16.5 antlr4-python3-runtime 4.9.3 attrs 24.2.0 audioread 3.0.1 Brotli 1.0.9 certifi 2024.8.30 cffi 1.17.1 charset-normalizer 3.4.0 crcmod 1.7 cryptography 43.0.3 datasets 2.16.0 decorator 5.1.1 dill 0.3.7 editdistance 0.8.1 filelock 3.13.1 frozenlist 1.5.0 fsspec 2023.10.0 funasr 1.1.14 gmpy2 2.1.2 huggingface-hub 0.26.2 hydra-core 1.3.2 idna 3.10 intel-cmplr-lib-ur 2024.2.1 intel-openmp 2024.2.1 jaconv 0.4.0 jamo 0.4.1 jieba 0.42.1 Jinja2 3.1.4 jmespath 0.10.0 joblib 1.4.2 kaldiio 2.18.0 lazy_loader 0.4 librosa 0.10.2.post1 llvmlite 0.43.0 MarkupSafe 2.1.3 mkl 2024.0.0 mkl_fft 1.3.11 mkl_random 1.2.8 mkl-service 2.4.0 modelscope 1.20.0 mpmath 1.3.0 msgpack 1.1.0 multidict 6.1.0 multiprocess 0.70.15 networkx 3.3 numba 0.60.0 numpy 2.0.2 omegaconf 2.3.0 oss2 2.19.1 packaging 24.2 pandas 2.2.3 pillow 10.4.0 pip 24.2 platformdirs 4.3.6 pooch 1.8.2 propcache 0.2.0 protobuf 5.28.3 pyarrow 18.0.0 pyarrow-hotfix 0.6 pycparser 2.22 pycryptodome 3.21.0 pynndescent 0.5.13 PySocks 1.7.1 python-dateutil 2.9.0.post0 pytorch-wpe 0.0.1 pytz 2024.2 PyYAML 6.0.2 requests 2.32.3 scikit-learn 1.5.2 scipy 1.14.1 sentencepiece 0.2.0 setuptools 75.1.0 simplejson 3.19.3 six 1.16.0 sortedcontainers 2.4.0 soundfile 0.12.1 soxr 0.5.0.post1 sympy 1.13.2 tbb 2021.13.1 tcmlib 1.2.0 tensorboardX 2.6.2.2 threadpoolctl 3.5.0 torch 2.3.1 torch-complex 0.4.4 torchaudio 2.3.1 torchvision 0.18.1 tqdm 4.67.0 triton 2.3.1 typing_extensions 4.12.2 tzdata 2024.2 umap-learn 0.5.7 umf 0.9.0 urllib3 2.2.3 wheel 0.44.0 xxhash 3.5.0 yarl 1.17.1