torch.hub.load('pyannote/pyannote-audio', 'dia') doesn't work in local

489 views Asked by At

I was using this code in google colab but it doesn't work when I want to use it in local

OWN_FILE = {'audio': 'file.wav'}


pipeline = torch.hub.load('pyannote/pyannote-audio', 'dia')
diarization = pipeline(OWN_FILE)

Here is the warnings I get for torch.hub.load :

FutureWarning: The 's' parameter is deprecated in favor of 'scale', and will be removed in a future release
  warnings.warn(msg, FutureWarning)

UserWarning: Model was trained with 4s chunks and is applied on 2s chunks. This might lead to sub-optimal results.
  warnings.warn(msg)

Someone has an idea to use pyannote in local ? Thanks in advance

1

There are 1 answers

0
Sadhana Singh On

you can simply apply the pipeline on audio file by giving the filePath. for exmaple:

filePath = "file.wav"
dia_pipeline = torch.hub.load("pyannote/pyannote-audio", "dia")
dia = dia_pipeline({"audio": str(filePath)})