Skip to content

Commit

Permalink
fixes #190 : avoid to write twice the header of a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeronymous committed Apr 22, 2024
1 parent 5d4fdaa commit a82e4d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions whisper_timestamped/transcribe.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit a82e4d8

Please sign in to comment.