From d2d840f06ce32a10f5184fff771ada4c3a53324c Mon Sep 17 00:00:00 2001 From: awerks Date: Thu, 17 Aug 2023 14:45:23 +0200 Subject: [PATCH] Update utils.py --- whisperx/utils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/whisperx/utils.py b/whisperx/utils.py index 36c7543..c68e224 100644 --- a/whisperx/utils.py +++ b/whisperx/utils.py @@ -225,6 +225,9 @@ class SubtitlesWriter(ResultWriter): highlight_words: bool = options["highlight_words"] max_line_width = 1000 if raw_max_line_width is None else raw_max_line_width preserve_segments = max_line_count is None or raw_max_line_width is None + + if len(result["segments"]) == 0: + return def iterate_subtitles(): line_len = 0