Skip to content

Commit

Permalink
Resolve Gradio errors (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
NeonDaniel committed Jun 22, 2023
1 parent 0a8c652 commit d2d8d14
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions ovos_stt_http_server/gradio_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@


def transcribe(audio_file, language: str):
with open(audio_file, 'rb') as f:
audio = f.read()
return STT.process_audio(bytes2audiodata(audio), language)

try:
with open(audio_file, 'rb') as f:
audio = f.read()
return STT.process_audio(bytes2audiodata(audio), language)
except TypeError:
LOG.error(f"Requested file not valid: {audio_file}")
except FileNotFoundError:
LOG.error(f"Requested file not found: {audio_file}")

def bind_gradio_service(app, stt_engine: ModelContainer,
title, description, info, badge,
Expand Down

0 comments on commit d2d8d14

Please sign in to comment.