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

Doesn't accept num_speakers as argument #798

Open
jhdeov opened this issue May 8, 2024 · 3 comments
Open

Doesn't accept num_speakers as argument #798

jhdeov opened this issue May 8, 2024 · 3 comments

Comments

@jhdeov
Copy link

jhdeov commented May 8, 2024

I'm running whisperx on an interview audio file. But I can't pass num_speakers as an argument

diarize_model = whisperx.DiarizationPipeline( use_auth_token=YOUR_HF_TOKEN, device=device)
diarize_segments = diarize_model( audio_path, num_speakers = 2
)

I get the error:

TypeError: DiarizationPipeline.call() got an unexpected keyword argument 'num_speakers'

@SeeknnDestroy
Copy link

Hey @jhdeov, diarize model does not accept num_speakers param but min_speakers and max_speakers instead.

diarize_model(input_audio_path, min_speakers=min_speakers, max_speakers=max_speakers)

I believe you can try to set them both to 2 and experiment what happens. Please let me know if it works!

@jhdeov
Copy link
Author

jhdeov commented May 15, 2024

It works.

@NebularNerd
Copy link

NebularNerd commented May 27, 2024

Hey @jhdeov, diarize model does not accept num_speakers param but min_speakers and max_speakers instead.

diarize_model(input_audio_path, min_speakers=min_speakers, max_speakers=max_speakers)

I believe you can try to set them both to 2 and experiment what happens. Please let me know if it works!

That did not work for me, I got the following error:
ERROR: DiarizationPipeline.__init__() got an unexpected keyword argument 'min_speakers'

Ah, I see I'm using the example python from the homepage which calls diarize differently:
diarize_model = whisperx.DiarizationPipeline(use_auth_token=YOUR_HF_TOKEN, device=device, min_speakers=args.minspeakers, max_speakers=args.maxspeakers)

Let's see how we fix that....

Well I fixed it with a pretty horrific bodge , no way I could submit it as a PR in its current state, need to improve it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants