Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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 |
-
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
|
| 238 |
voice_btn.click(
|
| 239 |
-
|
| 240 |
-
|
| 241 |
-
|
| 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 |
"""
|