From acff32780b442a714b0edb4bc79deb49d9d0b450 Mon Sep 17 00:00:00 2001 From: SevaSk Date: Tue, 30 May 2023 07:37:56 -0400 Subject: [PATCH] return nothing on error in get_transcription --- TranscriberModels.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/TranscriberModels.py b/TranscriberModels.py index 4650e63..843d18b 100644 --- a/TranscriberModels.py +++ b/TranscriberModels.py @@ -19,6 +19,7 @@ class WhisperTranscriber: result = self.audio_model.transcribe(wav_file_path, fp16=torch.cuda.is_available()) except Exception as e: print(e) + return '' return result['text'].strip() class APIWhisperTranscriber: @@ -30,5 +31,6 @@ class APIWhisperTranscriber: result = openai.Audio.translate("whisper-1", audio_file) except Exception as e: print(e) + return '' return result['text'].strip() \ No newline at end of file