Skip to content

Commit 0aab9f8

Browse files
committed
Update ASR model and add batch size and return
timestamps options
1 parent 9ceb18b commit 0aab9f8

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ pipeline = ASRDiarizationPipeline.from_pretrained(
7979
device=device,
8080
)
8181

82-
output_text = pipeline(audio_path)
82+
output_text = pipeline(audio_path, num_speakers=2, min_speaker=1, max_speaker=2)
8383
dialogue = format_speech_to_dialogue(output_text)
8484
print(dialogue)
8585
```

whisperplus/pipelines/whisper_diarize.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def __init__(
2424
@classmethod
2525
def from_pretrained(
2626
cls,
27-
asr_model: Optional[str] = "openai/whisper-medium",
27+
asr_model: Optional[str] = "openai/whisper-large-v3",
2828
*,
2929
diarizer_model: Optional[str] = "pyannote/speaker-diarization",
3030
chunk_length_s: Optional[int] = 30,
@@ -35,7 +35,9 @@ def from_pretrained(
3535
"automatic-speech-recognition",
3636
model=asr_model,
3737
chunk_length_s=chunk_length_s,
38-
token=use_auth_token, # 08/25/2023: Changed argument from use_auth_token to token
38+
token=use_auth_token,
39+
batch_size=24,
40+
return_timestamps=True,
3941
**kwargs,
4042
)
4143
diarization_pipeline = Pipeline.from_pretrained(diarizer_model, use_auth_token=use_auth_token)

0 commit comments

Comments
 (0)