Skip to content

Commit

Permalink
Pass device to pyannote.audio.Inference
Browse files Browse the repository at this point in the history
  • Loading branch information
smly committed Feb 21, 2023
1 parent f7093e6 commit 57f5957
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions whisperx/transcribe.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,12 @@ def cli():
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
vad_pipeline = Inference("pyannote/segmentation",
pre_aggregation_hook=lambda segmentation: segmentation,
use_auth_token=hf_token)
vad_pipeline = Inference(
"pyannote/segmentation",
pre_aggregation_hook=lambda segmentation: segmentation,
use_auth_token=hf_token,
device=torch.device(device),
)

diarize_pipeline = None
if diarize:
Expand Down

0 comments on commit 57f5957

Please sign in to comment.