Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用GPU进行模型语音转义进程CoreDump #1831

Open
majijia505 opened this issue Jun 19, 2024 · 2 comments
Open

使用GPU进行模型语音转义进程CoreDump #1831

majijia505 opened this issue Jun 19, 2024 · 2 comments
Labels
question Further information is requested

Comments

@majijia505
Copy link

majijia505 commented Jun 19, 2024

Notice: In order to resolve issues more efficiently, please raise issue following the template.
(注意:为了更加高效率解决您遇到的问题,请按照模板提问,补充细节)

❓ Questions and Help

Before asking:

  1. search the issues.
  2. 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

image

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:
@majijia505 majijia505 added the question Further information is requested label Jun 19, 2024
@LauraGPT
Copy link
Collaborator

We do not know what's your problem.

@majijia505
Copy link
Author

We do not know what's your problem.
When performing voice recognition, the process suddenly experienced a core dump, and the process terminated abruptly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants