Jatila commited on
Commit
2b9afa2
·
verified ·
1 Parent(s): 23c8db3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -10
app.py CHANGED
@@ -228,18 +228,24 @@ with gr.Blocks() as demo:
228
  gr.Markdown("### 🎤 Voice Input")
229
  audio_input = gr.Audio(sources=["microphone"], type="filepath", label="Record your question")
230
  voice_btn = gr.Button("🎤 Send Voice Message")
231
-
232
- text_btn.click(
233
- fn=text_pipeline,
234
- inputs=[text_input, chat_history, lang_selector],
235
- outputs=[chat_history, audio_output, text_input],
236
- )
237
 
238
  voice_btn.click(
239
- fn=voice_pipeline,
240
- inputs=[audio_input, chat_history],
241
- outputs=[chat_history, audio_output, text_input],
242
- )
 
 
 
 
 
 
243
 
244
  gr.Markdown(
245
  """
 
228
  gr.Markdown("### 🎤 Voice Input")
229
  audio_input = gr.Audio(sources=["microphone"], type="filepath", label="Record your question")
230
  voice_btn = gr.Button("🎤 Send Voice Message")
231
+ transcript_display = gr.Textbox(
232
+ label="📝 What I heard",
233
+ interactive=False,
234
+ lines=2,
235
+ placeholder="Your transcribed speech will appear here…",
236
+ )
237
 
238
  voice_btn.click(
239
+ fn=voice_pipeline,
240
+ inputs=[audio_input, chat_history],
241
+ outputs=[chat_history, audio_output, transcript_display],
242
+ )
243
+
244
+ text_btn.click(
245
+ fn=text_pipeline,
246
+ inputs=[text_input, chat_history, lang_selector],
247
+ outputs=[chat_history, audio_output, transcript_display],
248
+ )
249
 
250
  gr.Markdown(
251
  """