Closed imc-db closed 3 months ago
diarize_model = whisperx.DiarizationPipeline(
use_auth_token="<YOUR_HF_TOKEN>", device=device
)
diarize_segments = diarize_model(whisperx.load_audio(audio_file_path), num_speakers=2)
result: DataFrame = whisperx.assign_word_speakers(diarize_segments, result)
You can also make it into a shell command and run that instead.
I don't find any possibility to enable diarization from python code? Any help would be really appreciated.
model = whisper.load_model(model_whisper, device=device, diarize=True)
# ---> TypeError: load_model() got an unexpected keyword argument 'diarize'
model = whisper.load_model(model_whisper, device=device)
Same happens if I add this parameter to transcribe(...)
result = model.transcribe(audio_file)