From a82e4d884a504625e8d6a98265272e2cb14c0901 Mon Sep 17 00:00:00 2001 From: Jeronymous Date: Mon, 22 Apr 2024 19:59:42 +0200 Subject: [PATCH] fixes #190 : avoid to write twice the header of a file --- whisper_timestamped/transcribe.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) mode change 100644 => 100755 whisper_timestamped/transcribe.py diff --git a/whisper_timestamped/transcribe.py b/whisper_timestamped/transcribe.py old mode 100644 new mode 100755 index 4afbf7e..6233257 --- a/whisper_timestamped/transcribe.py +++ b/whisper_timestamped/transcribe.py @@ -3,7 +3,7 @@ __author__ = "Jérôme Louradour" __credits__ = ["Jérôme Louradour"] __license__ = "GPLv3" -__version__ = "1.15.3" +__version__ = "1.15.4" # Set some environment variables import os @@ -2946,14 +2946,14 @@ def cli(): def do_write(transcript, file, output_format): writer = get_writer(output_format, os.path.curdir) try: - return writer.write_result({"segments": transcript}, file) - except TypeError: - # Version > 20230314 return writer.write_result({"segments": list(transcript)}, file, { "highlight_words": False, "max_line_width": None, "max_line_count": None, }) + except TypeError: + # Version <= 20230314 + return writer.write_result({"segments": transcript}, file) def get_do_write(output_format): return lambda transcript, file: do_write(transcript, file, output_format)