FunASR
FunASR copied to clipboard
使用GPU进行模型语音转义进程CoreDump
Notice: In order to resolve issues more efficiently, please raise issue following the template. (注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)
❓ Questions and Help
Before asking:
- search the issues.
- search the docs.
What is your question?
在使用GPU进行模型推理时,进程会在ffmpeg转换完语音后coredump
Code
from funasr import AutoModel
model_path = "/app/base_models/speech_seaco_paraformer_large_asr_nat-zh-cn-16k-common-vocab8404-pytorch"
vad_model_path = "/app/base_models/speech_fsmn_vad_zh-cn-16k-common-pytorch"
punc_model_path = "/app/base_models/punc_ct-transformer_cn-en-common-vocab471067-large"
spk_model_path = "/app/base_models/speech_campplus_sv_zh-cn_16k-common"
model = AutoModel(model=model_path, vad_model=vad_model_path, punc_model=punc_model_path, spk_model=spk_model_path
)
def excute(file_path):
if not os.path.exists(file_path):
return "File not found"
start_time = time.time()
print("开始转换:"+file_path)
res = model.generate(input=file_path,
batch_size_s=300
)
end_time = time.time()
elapsed_time = end_time - start_time
for item in res:
for sentence in sorted(item['sentence_info'], key=lambda x: x['spk']):
print(f"spk: {sentence['spk']}, text: {sentence['text']}")
if 'spk' in sentence:
# 给spk的值加1,然后设置spkname字段
sentence['spkname'] = f"说话人{sentence['spk'] + 1}"
print(res)
print(f"语音转换耗时:{elapsed_time}")
result = []
for item in res:
texts = []
for sentence in item['sentence_info']:
texts.append({
'text': sentence['text'],
'start': sentence['start'],
'end': sentence['end'],
'spk': sentence['spk'],
'spkname': sentence['spkname']
})
result.append({
'text': item['text'],
'sentences': texts,
'time': elapsed_time
})
return result
在excute方法后,coredump
What have you tried?
What's your environment?
- OS (e.g., Linux):centos7
- FunASR Version (e.g., 1.0.0): v1.0.27
- ModelScope Version (e.g., 1.11.0):
- PyTorch Version (e.g., 2.0.0): 2.3.0+cu118
- How you installed funasr (
pip, source): pip - Python version:
- GPU (e.g., V100M32)
- CUDA/cuDNN version (e.g., cuda11.7): cuda11.8
- Docker version (e.g., funasr-runtime-sdk-cpu-0.4.1) N/A
- Any other relevant information:
We do not know what's your problem.
We do not know what's your problem. When performing voice recognition, the process suddenly experienced a core dump, and the process terminated abruptly.