Penality commited on
Commit
b26c7d3
·
verified ·
1 Parent(s): e8381dd

Update app.py

Browse files

Use gr.TabbedInterface to handle multiple functions

Files changed (1) hide show
  1. app.py +15 -7
app.py CHANGED
@@ -183,12 +183,20 @@ def helloWorld(text):
183
  return f"{text} : hello world"
184
 
185
  # Gradio Interface
186
- iface = gr.Interface(
187
- fn=[chatbot, helloWorld],
188
- inputs=[gr.File(label="Upload PDF"), gr.Textbox(label="Ask a Question")],
189
- outputs=gr.Textbox(label="Answer"),
190
- title="PDF Q&A Chatbot (Powered by Together.AI)"
191
- )
192
-
 
 
 
 
 
 
 
 
193
  # Launch Gradio app
194
  iface.launch()
 
183
  return f"{text} : hello world"
184
 
185
  # Gradio Interface
186
+ iface = gr.TabbedInterface(
187
+ [
188
+ gr.Interface(
189
+ fn=chatbot,
190
+ inputs=[gr.File(label="Upload PDF"), gr.Textbox(label="Ask a Question")],
191
+ outputs=gr.Textbox(label="Answer"),
192
+ title="PDF Q&A Chatbot (Powered by Together.AI)",
193
+ ),
194
+ gr.Interface(
195
+ fn=helloWorld,
196
+ inputs="text",
197
+ outputs="text",
198
+ )
199
+ ]
200
+
201
  # Launch Gradio app
202
  iface.launch()