Skip to content

当mp3时长超过3755秒时,就会报错:torch.OutOfMemoryError: CUDA out of memory. #2376

@libingbingd

Description

@libingbingd

在调用代码时,当mp3时长超过3755秒时,就会报错:torch.OutOfMemoryError: CUDA out of memory.

代码如下:
def load_model_to_asr(local_path):
model = AutoModel(
model=model_dir,
vad_model=vad_model,
punc_model=punc_model,
spk_model=spk_model,
vad_kwargs={"max_single_segment_time": 30000},
device="cuda:0",
)

# en
res = model.generate(
    #input=f"{model.model_path}/example/en.mp3",
    input=local_path,
    cache={},
    language="auto",  # "zn", "en", "yue", "ja", "ko", "nospeech"
    use_itn=True,
    batch_size_s=6000,
    merge_vad=True,  #
    merge_length_s=1500,
)

请问大佬们如何解决,或者如何使用多GPu;求解答

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions