Merge pull request #494 from mvoggu/main

fix: ZeroDivisionError when --print_progress True
This commit is contained in:
Max Bain
2023-09-27 07:46:06 -07:00
committed by GitHub

View File

@ -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: