diff --git a/whisperx/alignment.py b/whisperx/alignment.py index c0d9c84..d98c290 100644 --- a/whisperx/alignment.py +++ b/whisperx/alignment.py @@ -99,7 +99,8 @@ def align( interpolate_method: str = "nearest", return_char_alignments: bool = False, print_progress = False, - combined_progress = False + combined_progress = False, + total_segments = 0 ) -> AlignedTranscriptionResult: """ Align phoneme recognition predictions to known transcription. @@ -118,9 +119,6 @@ def align( model_lang = align_model_metadata["language"] model_type = align_model_metadata["type"] - total_segments = len(list(transcript)) - transcript = iter(transcript) - # 1. Preprocess to keep only characters in dictionary for sdx, segment in enumerate(transcript): # strip spaces at beginning / end, but keep track of the amount.