Skip to content

Commit a93ca91

Browse files
Merge pull request #1 from m-bain/main
Fix VAD Path for Custom VAD loading
2 parents 6bb2f1c + 8227807 commit a93ca91

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
open(os.path.join(os.path.dirname(__file__), "requirements.txt"))
2222
)
2323
]
24-
+ [f"pyannote.audio==3.1.0"],
24+
+ [f"pyannote.audio==3.1.1"],
2525
entry_points={
2626
"console_scripts": ["whisperx=whisperx.transcribe:cli"],
2727
},

whisperx/diarize.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ def __init__(
1818
device = torch.device(device)
1919
self.model = Pipeline.from_pretrained(model_name, use_auth_token=use_auth_token).to(device)
2020

21-
def __call__(self, audio: Union[str, np.ndarray], min_speakers=None, max_speakers=None):
21+
def __call__(self, audio: Union[str, np.ndarray], num_speakers=None, min_speakers=None, max_speakers=None):
2222
if isinstance(audio, str):
2323
audio = load_audio(audio)
2424
audio_data = {
2525
'waveform': torch.from_numpy(audio[None, :]),
2626
'sample_rate': SAMPLE_RATE
2727
}
28-
segments = self.model(audio_data, min_speakers=min_speakers, max_speakers=max_speakers)
28+
segments = self.model(audio_data, num_speakers = num_speakers, min_speakers=min_speakers, max_speakers=max_speakers)
2929
diarize_df = pd.DataFrame(segments.itertracks(yield_label=True), columns=['segment', 'label', 'speaker'])
3030
diarize_df['start'] = diarize_df['segment'].apply(lambda x: x.start)
3131
diarize_df['end'] = diarize_df['segment'].apply(lambda x: x.end)

0 commit comments

Comments
 (0)