Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -77,13 +77,13 @@ def restaurant_voice_assistant(audio, state_json):
|
|
| 77 |
|
| 78 |
with gr.Blocks() as demo:
|
| 79 |
state = gr.State(value=json.dumps({}))
|
| 80 |
-
|
| 81 |
with gr.Row():
|
| 82 |
-
user_audio = gr.Audio(type="filepath", label="Your Voice Input")
|
| 83 |
output_text = gr.Textbox(label="Response Text")
|
| 84 |
-
|
| 85 |
with gr.Row():
|
| 86 |
-
voice_output = gr.Audio(label="Response Audio",
|
| 87 |
|
| 88 |
submit_btn = gr.Button("Submit")
|
| 89 |
submit_btn.click(restaurant_voice_assistant, inputs=[user_audio, state], outputs=[output_text, voice_output, state])
|
|
|
|
| 77 |
|
| 78 |
with gr.Blocks() as demo:
|
| 79 |
state = gr.State(value=json.dumps({}))
|
| 80 |
+
|
| 81 |
with gr.Row():
|
| 82 |
+
user_audio = gr.Audio(source="microphone", type="filepath", label="Your Voice Input")
|
| 83 |
output_text = gr.Textbox(label="Response Text")
|
| 84 |
+
|
| 85 |
with gr.Row():
|
| 86 |
+
voice_output = gr.Audio(label="Response Audio", autoplay=True)
|
| 87 |
|
| 88 |
submit_btn = gr.Button("Submit")
|
| 89 |
submit_btn.click(restaurant_voice_assistant, inputs=[user_audio, state], outputs=[output_text, voice_output, state])
|