avfranco commited on
Commit
db0a348
1 Parent(s): 359ae82

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -34,13 +34,15 @@ def respond_to_question_llama(transcript, question):
34
 
35
  @spaces.GPU
36
  def audio_transcribe(inputs):
 
37
  if inputs is None:
38
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
39
- return
 
 
 
40
 
41
- text = pipe(inputs, batch_size=BATCH_SIZE, return_timestamps=True)['text']
42
-
43
- return [text, gr.Textbox(visible=True),gr.Textbox(visible=True),gr.Textbox(visible=True)]
44
 
45
  def hidden_ask_question():
46
  return [gr.Textbox(visible=False),gr.Textbox(visible=False),gr.Textbox(visible=False)]
 
34
 
35
  @spaces.GPU
36
  def audio_transcribe(inputs):
37
+ status=True
38
  if inputs is None:
39
  raise gr.Error("No audio file submitted! Please upload or record an audio file before submitting your request.")
40
+ text=""
41
+ status=False
42
+ else:
43
+ text = pipe(inputs, batch_size=BATCH_SIZE, return_timestamps=True)['text']
44
 
45
+ return [text, gr.Textbox(visible=status),gr.Textbox(visible=status),gr.Textbox(visible=status)]
 
 
46
 
47
  def hidden_ask_question():
48
  return [gr.Textbox(visible=False),gr.Textbox(visible=False),gr.Textbox(visible=False)]