Merge pull request #114 from mshakirDr/patch-1

Fix hugging face error
This commit is contained in:
m-bain
2023-03-23 15:12:09 -07:00
committed by GitHub

View File

@ -639,9 +639,10 @@ def cli():
if vad_filter: if vad_filter:
if hf_token is None: 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...") 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( vad_pipeline = Inference(
"pyannote/segmentation", Model.from_pretrained("pyannote/segmentation",
use_auth_token=hf_token),
pre_aggregation_hook=lambda segmentation: segmentation, pre_aggregation_hook=lambda segmentation: segmentation,
use_auth_token=hf_token, use_auth_token=hf_token,
device=torch.device(device), device=torch.device(device),