From 6cb7267dc2b566d2cdb880288944bf6854e7b946 Mon Sep 17 00:00:00 2001 From: awerks Date: Thu, 17 Aug 2023 14:56:54 +0200 Subject: [PATCH] Update alignment.py --- whisperx/alignment.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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.