Spaces:
Sleeping
Sleeping
Update app.py
Browse filesUse gr.TabbedInterface to handle multiple functions
app.py
CHANGED
@@ -183,12 +183,20 @@ def helloWorld(text):
|
|
183 |
return f"{text} : hello world"
|
184 |
|
185 |
# Gradio Interface
|
186 |
-
iface = gr.
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
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()
|