adeelshuaib commited on
Commit
36bb34e
·
verified ·
1 Parent(s): bfdd8ad

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -87,7 +87,10 @@ def gradio_interface():
87
  def process_audio(audio_file, history):
88
  if audio_file:
89
  transcription = audio_to_text(audio_file) # Convert audio to text
90
- history.append({"role": "user", "content": transcription})
 
 
 
91
  return history
92
 
93
  # Set up interaction flow:
 
87
  def process_audio(audio_file, history):
88
  if audio_file:
89
  transcription = audio_to_text(audio_file) # Convert audio to text
90
+ if transcription:
91
+ history.append({"role": "user", "content": transcription})
92
+ else:
93
+ history.append({"role": "assistant", "content": "I couldn't understand your audio. Please try again."})
94
  return history
95
 
96
  # Set up interaction flow: