Skip to content

Commit 5fcc6be

Browse files
jongwookabyesilyurt
authored andcommitted
use stdout for printing transcription progress (openai#867)
1 parent ed24175 commit 5fcc6be

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

whisper/transcribe.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ def add_segment(
171171
line = f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}\n"
172172
# compared to just `print(line)`, this replaces any character not representable using
173173
# the system default encoding with an '?', avoiding UnicodeEncodeError.
174-
sys.stderr.buffer.write(line.encode(sys.getdefaultencoding(), errors="replace"))
174+
sys.stdout.buffer.write(line.encode(sys.getdefaultencoding(), errors="replace"))
175+
sys.stdout.flush()
175176

176177
# show the progress bar when verbose is False (otherwise the transcribed text will be printed)
177178
num_frames = mel.shape[-1]

0 commit comments

Comments
 (0)