mirror of
https://github.com/SevaSk/ecoute.git
synced 2024-12-19 20:57:53 +00:00
return nothing on error in get_transcription
This commit is contained in:
parent
0227cc7fcb
commit
acff32780b
@ -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()
|
Loading…
Reference in New Issue
Block a user