MahmoudAshraf97 / whisper-diarization

Automatic Speech Recognition with Speaker Diarization based on OpenAI Whisper
BSD 2-Clause "Simplified" License
3.43k stars 288 forks source link

diarize.py unexpected keyword argument ‘max_new_tokens’ #165

Closed transcriptionstream closed 7 months ago

transcriptionstream commented 7 months ago

Maybe related to the new version of whisperx, but running whisper-diarization results in the following error:

Traceback (most recent call last):
  File "/whisper-diarization/diarize.py", line 97, in <module>
    whisper_results, language = transcribe_batched(
  File "/whisper-diarization/transcription_helpers.py", line 63, in transcribe_batched
    whisper_model = whisperx.load_model(
  File "/usr/local/lib/python3.10/dist-packages/whisperx/asr.py", line 334, in load_model
    default_asr_options = faster_whisper.transcribe.TranscriptionOptions(**default_asr_options)
TypeError: TranscriptionOptions.__new__() got an unexpected keyword argument 'max_new_tokens'
MahmoudAshraf97 commented 7 months ago

make sure you are using faster-whisper==1.0.0

transcriptionstream commented 7 months ago

I'm working with a clean build from the updated whisper-diarization git that includes the new whisperx version. Is the faster-whisper version defined in git+https://github.com/m-bain/whisperX.git@d6562c26da467ca49866a4173c0e723f3837f367 from the whisper-diarization requirements.txt?

Edit - looks like https://github.com/m-bain/whisperX/commits/main/d6562c26da467ca49866a4173c0e723f3837f367 is referencing faster-whisper~=0.10.0 while the latest commit includes faster-whisper==1.0.0 https://github.com/m-bain/whisperX/commit/78dcfaab51005aa703ee21375f81ed31bc248560

transcriptionstream commented 7 months ago

using the latest commit of whisperx resolves the issue - https://github.com/m-bain/whisperX/commit/78dcfaab51005aa703ee21375f81ed31bc248560

transcriptionstream commented 7 months ago

the whisperx line in requirements.txt needs to be updated from

git+https://github.com/m-bain/whisperX.git@d6562c26da467ca49866a4173c0e723f3837f367

to

git+https://github.com/m-bain/whisperX.git

to install faster-whisper==1.0.0