Chia Woon Yap commited on
Commit
3bd47ae
·
verified ·
1 Parent(s): 9aa5a76

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -10
app.py CHANGED
@@ -284,22 +284,31 @@ def tutor_ai_chatbot():
284
  gr.Markdown("An interactive Personal AI Tutor chatbot to help with your learning needs.")
285
 
286
  # Chatbot Tab
287
- with gr.Tab("AI Chatbot"):
288
  with gr.Row():
289
  with gr.Column(scale=3):
290
  chatbot = gr.Chatbot(height=500, type="messages")
291
- with gr.Row():
292
- msg = gr.Textbox(label="Ask a question", placeholder="Type your question here...")
293
- submit = gr.Button("Send")
294
-
295
- with gr.Column(scale=1):
296
- audio_input = gr.Audio(type="numpy", label="Record or Upload Audio")
297
-
298
  with gr.Column(scale=1):
299
- audio_playback = gr.Audio(label="Audio Response", type="filepath")
300
-
 
 
 
 
 
 
 
 
 
 
 
 
 
301
  # Clear chat history button
302
  clear_btn = gr.Button("Clear Chat")
 
 
303
 
304
  # Handle chat interaction
305
  submit.click(
 
284
  gr.Markdown("An interactive Personal AI Tutor chatbot to help with your learning needs.")
285
 
286
  # Chatbot Tab
287
+ with gr.Tab("AI Chatbot"):
288
  with gr.Row():
289
  with gr.Column(scale=3):
290
  chatbot = gr.Chatbot(height=500, type="messages")
291
+
 
 
 
 
 
 
292
  with gr.Column(scale=1):
293
+ audio_playback = gr.Audio(label="Audio Response", type="filepath")
294
+
295
+ # Move the input controls here to span full width
296
+ with gr.Row():
297
+ msg = gr.Textbox(
298
+ label="Ask a question",
299
+ placeholder="Type your question here...",
300
+ container=False # Removes the default container styling
301
+ )
302
+ submit = gr.Button("Send")
303
+
304
+ with gr.Row():
305
+ with gr.Column(scale=1):
306
+ audio_input = gr.Audio(type="numpy", label="Record or Upload Audio")
307
+
308
  # Clear chat history button
309
  clear_btn = gr.Button("Clear Chat")
310
+
311
+ # ... rest of your event handlers remain the same
312
 
313
  # Handle chat interaction
314
  submit.click(