Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)
ERROR:root:(Requestid:icJbZJDNCuitdTph) bt:Traceback (most recent call last):
File "/main.py", line 152, in speech_to_txt
result = task.transcribe(audio_for_transcribe, act_datetime, need_diarization)
File "/speech2txt_fast_whisper.py", line 131, in transcribe
return self.funasr_transcribe(audio, act_datetime, need_diarization)
File "/speech2txt_fast_whisper.py", line 152, in funasr_transcribe
res = self.funasr.transcribe(audio, need_diarization)
File "/speech2txt_funasr.py", line 19, in transcribe
res = self.model.generate(audio_path, batch_size_s=300, hotword='')
File "/usr/local/lib/python3.10/dist-packages/funasr/auto/auto_model.py", line 304, in generate
return self.inference_with_vad(input, input_len=input_len, **cfg)
File "/usr/local/lib/python3.10/dist-packages/funasr/auto/auto_model.py", line 377, in inference_with_vad
res = self.inference(
File "/usr/local/lib/python3.10/dist-packages/funasr/auto/auto_model.py", line 343, in inference
res = model.inference(**batch, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/funasr/models/fsmn_vad_streaming/model.py", line 722, in inference
segments_i = self.forward(**batch)
File "/usr/local/lib/python3.10/dist-packages/funasr/models/fsmn_vad_streaming/model.py", line 564, in forward
self.DetectCommonFrames(cache=cache)
File "/usr/local/lib/python3.10/dist-packages/funasr/models/fsmn_vad_streaming/model.py", line 760, in DetectCommonFrames
frame_state = self.GetFrameState(
File "/usr/local/lib/python3.10/dist-packages/funasr/models/fsmn_vad_streaming/model.py", line 518, in GetFrameState
sum_score = cache["stats"].scores[0][t][cache["stats"].sil_pdf_ids[0]].item()
IndexError: index 210056 is out of bounds for dimension 0 with size 210054
Define a global AutoModel, then call it serially. After running for a while, an error will occur.
from funasr import AutoModel
import config
import datetime
import re
class FunASR():
def __init__(self):
self.model = AutoModel(
model='iic/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch',
vad_model='iic/speech_fsmn_vad_zh-cn-16k-common-pytorch',
punc_model='iic/punc_ct-transformer_cn-en-common-vocab471067-large',
spk_model='iic/speech_campplus_sv_zh-cn_16k-common',
device="cuda",
trust_remote_code=True,
)
def transcribe(self, audio_path, need_diarization):
res = self.model.generate(audio_path, batch_size_s=300)
return res
Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)
🐛 Bug
To Reproduce
Define a global AutoModel, then call it serially. After running for a while, an error will occur.
Code sample
Expected behavior
Environment
pip, source): pip install funasr -i https://pypi.tuna.tsinghua.edu.cn/simpleAdditional context