From cea42ca470b1dbeecfeee31bf14cce4ad8a621b2 Mon Sep 17 00:00:00 2001 From: Muhammad Shakir <46898829+mshakirDr@users.noreply.github.com> Date: Sat, 4 Mar 2023 19:12:13 +0100 Subject: [PATCH] Fix hugging face error Model should be loaded with an id to avoid this error: huggingface_hub.utils._validators.HFValidationError: Repo id must use alphanumeric chars or '-', '_', '.', '--' and '..' are forbidden, '-' and '.' cannot start or end the name, max length is 96: 'pyannote\segmentation'. --- whisperx/transcribe.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/whisperx/transcribe.py b/whisperx/transcribe.py index 88e348d..2efec7a 100644 --- a/whisperx/transcribe.py +++ b/whisperx/transcribe.py @@ -639,9 +639,10 @@ def cli(): if vad_filter: if hf_token is None: print("Warning, no huggingface token used, needs to be saved in environment variable, otherwise will throw error loading VAD model...") - from pyannote.audio import Inference + from pyannote.audio import Inference, Model vad_pipeline = Inference( - "pyannote/segmentation", + Model.from_pretrained("pyannote/segmentation", + use_auth_token=hf_token), pre_aggregation_hook=lambda segmentation: segmentation, use_auth_token=hf_token, device=torch.device(device),