From a0b6459c8b782fdcde58f59b7aef9f65aefbfffa Mon Sep 17 00:00:00 2001 From: Manohar Reddy Date: Wed, 27 Sep 2023 20:10:43 +0530 Subject: [PATCH] fix: ZeroDivisionError when --print_progress True --- whisperx/alignment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whisperx/alignment.py b/whisperx/alignment.py index dd2465ac..132e3595 100644 --- a/whisperx/alignment.py +++ b/whisperx/alignment.py @@ -100,7 +100,6 @@ def align( return_char_alignments: bool = False, print_progress: bool = False, combined_progress: bool = False, - total_segments: int = 0 ) -> AlignedTranscriptionResult: """ Align phoneme recognition predictions to known transcription. @@ -120,6 +119,7 @@ def align( model_type = align_model_metadata["type"] # 1. Preprocess to keep only characters in dictionary + total_segments = len(transcript) for sdx, segment in enumerate(transcript): # strip spaces at beginning / end, but keep track of the amount. if print_progress: