Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add diarization_model argument to CLI #83

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/insanely_fast_whisper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,13 @@ def post_process_segments_and_transcripts(new_segments, transcript, group_by_spe
type=str,
help="Provide a hf.co/settings/token for Pyannote.audio to diarise the audio clips",
)

parser.add_argument(
"--diarization_model",
required=False,
default="pyannote/speaker-diarization",
kadirnar marked this conversation as resolved.
Show resolved Hide resolved
type=str,
help="Name of the pretrained model/ checkpoint to perform diarization. (default: pyannote/speaker-diarization)",
)

def main():
args = parser.parse_args()
Expand Down Expand Up @@ -261,7 +267,8 @@ def main():

if args.hf_token != "no_token":
diarization_pipeline = Pipeline.from_pretrained(
"pyannote/speaker-diarization-3.1", use_auth_token=args.hf_token
checkpoint_path=args.diarization_model,
use_auth_token=args.hf_token,
)
diarization_pipeline.to(
torch.device("mps" if args.device_id == "mps" else f"cuda:{args.device_id}")
Expand Down