pytorch 如何在CPU上运行pyannote.audio?

agxfikkp  于 2023-10-20  发布在  其他
关注(0)|答案(1)|浏览(144)

我正在运行pyannote并得到错误:“CUDA out of memory“。
正因为如此,我想在CPU而不是GPU上运行我的代码。

from pyannote.audio import Pipeline

pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization",use_auth_token="token...")

diarization = pipeline("example.wav")

如何在给定上述配置的CPU上运行扬声器日志化管道?

eeq64g8w

eeq64g8w1#

你可以用手电筒

from pyannote.audio import Pipeline
import torch

pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization",use_auth_token="token...")
device = torch.device("cpu")
pipeline.to(device)
diarization = pipeline("example.wav")

相关问题