From 40e1d6a655a42fba156d5fa9bde192cbc77c3107 Mon Sep 17 00:00:00 2001 From: simon300000 Date: Sun, 11 Dec 2022 21:49:38 +0100 Subject: [PATCH] verbose catch text encode error --- whisper/transcribe.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/whisper/transcribe.py b/whisper/transcribe.py index a4c3326ca..4d4f0bf25 100644 --- a/whisper/transcribe.py +++ b/whisper/transcribe.py @@ -165,7 +165,10 @@ def add_segment( } ) if verbose: - print(f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}") + try: + print(f"[{format_timestamp(start)} --> {format_timestamp(end)}] {text}") + except UnicodeEncodeError: + print(f"[{format_timestamp(start)} --> {format_timestamp(end)}] ") # show the progress bar when verbose is False (otherwise the transcribed text will be printed) num_frames = mel.shape[-1]