Compare commits

...

2 Commits

Author SHA1 Message Date
Pranay Gosar d03b2fa46d
Merge 9fb6d948d0 into fd20265324 2024-04-26 01:57:45 +03:00
pyp_l40 fd20265324 fix number bug in whisperx alignment 2024-04-25 14:38:03 -05:00
1 changed files with 3 additions and 1 deletions

View File

@ -74,6 +74,8 @@ class WhisperxModel:
def transcribe(self, audio_path):
segments = self.model.transcribe(audio_path, batch_size=8)["segments"]
for segment in segments:
segment['text'] = replace_numbers_with_words(segment['text'])
return self.align_model.align(segments, audio_path)
@ -177,7 +179,7 @@ def align(seed, transcript, audio_path):
if align_model is None:
raise gr.Error("Align model not loaded")
seed_everything(seed)
transcript = replace_numbers_with_words(transcript).replace(" ", " ").replace(" ", " ")
fragments = align_segments(transcript, audio_path)
segments = [{
"start": float(fragment["begin"]),