shukdevdatta123 commited on
Commit
13a5c1f
·
verified ·
1 Parent(s): 2f56112

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -16
app.py CHANGED
@@ -243,24 +243,26 @@ def create_interface():
243
  with gr.Accordion("Click to expand for details", open=False):
244
  gr.Markdown("""### Description: This is a multimodal chatbot that can handle text, image, and voice inputs. [Explanation Here]""")
245
 
246
- with gr.TabbedInterface():
247
- with gr.TabItem("Text Chat"):
248
- input_text = gr.Textbox(label="Enter Text Question", placeholder="Ask a question or provide text", lines=2)
249
- submit_btn = gr.Button("Ask!")
250
- chat_history = gr.Chatbot()
251
- submit_btn.click(fn=chatbot, inputs=[input_text, None, None, gr.Textbox(), "medium", "o3-mini", chat_history], outputs=[input_text, chat_history])
252
 
253
- with gr.TabItem("Image Chat"):
254
- image_input = gr.Image(label="Upload an Image", type="pil")
255
- submit_btn = gr.Button("Ask!")
256
- chat_history = gr.Chatbot()
257
- submit_btn.click(fn=chatbot, inputs=[None, image_input, None, gr.Textbox(), "medium", "o1", chat_history], outputs=[input_text, chat_history])
258
 
259
- with gr.TabItem("Voice Chat"):
260
- audio_input = gr.Audio(label="Upload or Record Audio", type="filepath")
261
- submit_btn = gr.Button("Ask!")
262
- chat_history = gr.Chatbot()
263
- submit_btn.click(fn=chatbot, inputs=[None, None, audio_input, gr.Textbox(), "medium", "o3-mini", chat_history], outputs=[input_text, chat_history])
 
 
 
264
 
265
  return demo
266
 
 
243
  with gr.Accordion("Click to expand for details", open=False):
244
  gr.Markdown("""### Description: This is a multimodal chatbot that can handle text, image, and voice inputs. [Explanation Here]""")
245
 
246
+ with gr.TabItem("Text Chat"):
247
+ input_text = gr.Textbox(label="Enter Text Question", placeholder="Ask a question or provide text", lines=2)
248
+ submit_btn = gr.Button("Ask!")
249
+ chat_history = gr.Chatbot()
250
+ submit_btn.click(fn=chatbot, inputs=[input_text, None, None, gr.Textbox(), "medium", "o3-mini", chat_history], outputs=[input_text, chat_history])
 
251
 
252
+ with gr.TabItem("Image Chat"):
253
+ image_input = gr.Image(label="Upload an Image", type="pil")
254
+ submit_btn = gr.Button("Ask!")
255
+ chat_history = gr.Chatbot()
256
+ submit_btn.click(fn=chatbot, inputs=[None, image_input, None, gr.Textbox(), "medium", "o1", chat_history], outputs=[input_text, chat_history])
257
 
258
+ with gr.TabItem("Voice Chat"):
259
+ audio_input = gr.Audio(label="Upload or Record Audio", type="filepath")
260
+ submit_btn = gr.Button("Ask!")
261
+ chat_history = gr.Chatbot()
262
+ submit_btn.click(fn=chatbot, inputs=[None, None, audio_input, gr.Textbox(), "medium", "o3-mini", chat_history], outputs=[input_text, chat_history])
263
+
264
+ # Interface list is a list of all tabs
265
+ interface_list = [input_text, image_input, audio_input]
266
 
267
  return demo
268