DurreSudoku commited on
Commit
87b4ae0
·
verified ·
1 Parent(s): f076afe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -4,6 +4,7 @@ import os
4
  import random
5
  from transformers import pipeline
6
  from difflib import SequenceMatcher
 
7
 
8
  all_images = os.listdir("assets")
9
  current_image = None
@@ -43,7 +44,8 @@ def transcribe(audio):
43
  # Transcribe the audio and split the string into a list of words
44
  try:
45
  transcribed_audio = pipe(audio)["text"]
46
- except:
 
47
  return "Encountered an error. Are you sure that you recorded audio before submitting?"
48
 
49
  transcribed_audio = transcribed_audio.replace(",", "")
 
4
  import random
5
  from transformers import pipeline
6
  from difflib import SequenceMatcher
7
+ import logging
8
 
9
  all_images = os.listdir("assets")
10
  current_image = None
 
44
  # Transcribe the audio and split the string into a list of words
45
  try:
46
  transcribed_audio = pipe(audio)["text"]
47
+ except Exception as e:
48
+ logging.exception(e)
49
  return "Encountered an error. Are you sure that you recorded audio before submitting?"
50
 
51
  transcribed_audio = transcribed_audio.replace(",", "")