Update app.py
Browse files
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.
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
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 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
|
|
|
|
|
|
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 |
|