m-bain / whisperX

WhisperX: Automatic Speech Recognition with Word-level Timestamps (& Diarization)
BSD 2-Clause "Simplified" License
12.71k stars 1.35k forks source link

Crashed by ZeroDivisionError when set "--print_progress True" #502

Open antiPoP opened 1 year ago

antiPoP commented 1 year ago

Hi, I'm still experiencing #477:

>>Performing alignment...
Traceback (most recent call last):
  File "/home/code/apps/miniconda3/envs/whisperx/bin/whisperx", line 8, in <module>
    sys.exit(cli())
  File "/home/code/apps/miniconda3/envs/whisperx/lib/python3.10/site-packages/whisperx/transcribe.py", line 195, in cli
    result = align(result["segments"], align_model, align_metadata, input_audio, device, interpolate_method=interpolate_method, return_char_alignments=return_char_alignments, print_progress=print_progress)
  File "/home/code/apps/miniconda3/envs/whisperx/lib/python3.10/site-packages/whisperx/alignment.py", line 126, in align
    base_progress = ((sdx + 1) / total_segments) * 100
ZeroDivisionError: division by zero
VatinaCharo commented 1 year ago

you can try to update your whisperx by: pip install git+https://github.com/m-bain/whisperx.git --upgrade Bug has been fixed in Sep 27.

antiPoP commented 1 year ago

It happens with the latest version. total_segments can be zero, what is not checked:

https://github.com/m-bain/whisperX/blob/4cdce3b927a4dcf8eea1da2b68e36290095c4812/whisperx/alignment.py#L121-L128

saveli commented 1 year ago

Can confirm, still same error on 16th Oct.

Edit: Curiously only when running on cpu and int8, not happening on cuda and float32. Don't know if this is relevant.