FunASR
FunASR copied to clipboard
粤语识别模型推理出错,是否有长音频的模型
系统:ubuntu22.04 版本信息: funasr==1.0.18,modelscope==1.11.1
推理代码: from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks
inference_pipeline = pipeline( task=Tasks.auto_speech_recognition, model='damo/speech_UniASR_asr_2pass-cantonese-CHS-16k-common-vocab1468-tensorflow1-online',model_revision='v2.0.4', vad_model='iic/speech_fsmn_vad_zh-cn-16k-common-pytorch', vad_model_revision="v2.0.4", vad_kwargs={"max_single_segment_time": 60000}, punc_model='iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch', punc_model_revision="v2.0.4", )
rec_result = inference_pipeline(input='./0325.wav') print(rec_result[0])
问题:0325.wav该音频时长4分钟,推理出错,取前10s钟能正常推理
错误信息:
2024-03-25 17:45:42,026 - modelscope - INFO - PyTorch version 2.1.2 Found.
2024-03-25 17:45:42,027 - modelscope - INFO - Loading ast index from /home/fresh/.cache/modelscope/ast_indexer
2024-03-25 17:45:42,082 - modelscope - INFO - Loading done! Current index file version is 1.11.1, with md5 9271928ad57a76e3f712e4e1331c1640 and a total number of 956 components indexed
2024-03-25 17:45:44,582 - modelscope - INFO - Use user-specified model revision: v2.0.4
2024-03-25 17:45:44,877 - modelscope - INFO - initiate model from /home/fresh/.cache/modelscope/hub/damo/speech_UniASR_asr_2pass-cantonese-CHS-16k-common-vocab1468-tensorflow1-online
2024-03-25 17:45:44,878 - modelscope - INFO - initiate model from location /home/fresh/.cache/modelscope/hub/damo/speech_UniASR_asr_2pass-cantonese-CHS-16k-common-vocab1468-tensorflow1-online.
2024-03-25 17:45:44,879 - modelscope - INFO - initialize model from /home/fresh/.cache/modelscope/hub/damo/speech_UniASR_asr_2pass-cantonese-CHS-16k-common-vocab1468-tensorflow1-online
Notice: If you want to use whisper, please pip install -U openai-whisper
ckpt: /home/fresh/.cache/modelscope/hub/damo/speech_UniASR_asr_2pass-cantonese-CHS-16k-common-vocab1468-tensorflow1-online/model.pt
2024-03-25 17:45:55,775 - modelscope - INFO - Use user-specified model revision: v2.0.4
ckpt: /home/fresh/.cache/modelscope/hub/iic/speech_fsmn_vad_zh-cn-16k-common-pytorch/model.pt
2024-03-25 17:45:56,654 - modelscope - INFO - Use user-specified model revision: v2.0.4
ckpt: /home/fresh/.cache/modelscope/hub/iic/punc_ct-transformer_zh-cn-common-vocab272727-pytorch/model.pt
2024-03-25 17:45:59,121 - modelscope - WARNING - No preprocessor field found in cfg.
2024-03-25 17:45:59,122 - modelscope - WARNING - No val key and type key found in preprocessor domain of configuration.json file.
2024-03-25 17:45:59,122 - modelscope - WARNING - Cannot find available config to build preprocessor at mode inference, current config: {'model_dir': '/home/fresh/.cache/modelscope/hub/damo/speech_UniASR_asr_2pass-cantonese-CHS-16k-common-vocab1468-tensorflow1-online'}. trying to build by task and model information.
2024-03-25 17:45:59,122 - modelscope - WARNING - No preprocessor key ('funasr', 'auto-speech-recognition') found in PREPROCESSOR_MAP, skip building preprocessor.
rtf_avg: 2.026: 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:05<00:00, 5.31s/it]
0%| | 0/1 [00:00<?, ?it/s]Traceback (most recent call last): | 0/52 [00:00<?, ?it/s]
File "infer_asr.py", line 12, in
我用这个模型,10s的句子也会出错