Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -70,8 +70,9 @@ with gr.Blocks() as demo:
|
|
| 70 |
gpt_voice = gr.Audio(label="Listen to Advice")
|
| 71 |
with gr.Column(scale=2):
|
| 72 |
user_transcript = gr.Text(label="Audio Translation", interactive=False)
|
| 73 |
-
user_text = gr.Text(label="Text Input")
|
| 74 |
gpt_transcript = gr.Text(label="Chat Transcript")
|
|
|
|
| 75 |
submit_btn.click(transcribe, user_audio, user_transcript)
|
| 76 |
submit_btn2.click(botResponse, [user_text, messages], gpt_transcript)
|
| 77 |
user_transcript.change(botResponse, [user_transcript, messages], gpt_transcript)
|
|
|
|
| 70 |
gpt_voice = gr.Audio(label="Listen to Advice")
|
| 71 |
with gr.Column(scale=2):
|
| 72 |
user_transcript = gr.Text(label="Audio Translation", interactive=False)
|
| 73 |
+
user_text = gr.Text(label="Text Input",on_enter=True)
|
| 74 |
gpt_transcript = gr.Text(label="Chat Transcript")
|
| 75 |
+
user_text.on_enter(botResponse, [user_text, messages], gpt_transcript) # Bind the action to on_enter
|
| 76 |
submit_btn.click(transcribe, user_audio, user_transcript)
|
| 77 |
submit_btn2.click(botResponse, [user_text, messages], gpt_transcript)
|
| 78 |
user_transcript.change(botResponse, [user_transcript, messages], gpt_transcript)
|