Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -29,31 +29,16 @@ def predict_chatbot(input, history=[]):
|
|
29 |
response_tuples = [(response[i], response[i+1]) for i in range(0, len(response)-1, 2)]
|
30 |
return response_tuples, history
|
31 |
|
32 |
-
chatbot_gradio_app = gr.
|
33 |
fn=predict_chatbot,
|
34 |
inputs=gr.Textbox(show_label=False, placeholder="Enter text and press enter"),
|
35 |
outputs=gr.Textbox(),
|
36 |
live=True,
|
37 |
-
title="
|
38 |
)
|
39 |
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
}
|
46 |
-
|
47 |
-
.gr-tab-title {
|
48 |
-
color: #004d00 !important; /* Dark green title color */
|
49 |
-
}
|
50 |
-
|
51 |
-
.gr-title {
|
52 |
-
color: #004d00 !important; /* Dark green title color */
|
53 |
-
}
|
54 |
-
</style>
|
55 |
-
"""
|
56 |
-
|
57 |
-
# Add custom HTML to each Gradio interface
|
58 |
-
image_gradio_app.launch(share=True, debug=True, inline_css=custom_html)
|
59 |
-
chatbot_gradio_app.launch(share=True, debug=True, inline_css=custom_html)
|
|
|
29 |
response_tuples = [(response[i], response[i+1]) for i in range(0, len(response)-1, 2)]
|
30 |
return response_tuples, history
|
31 |
|
32 |
+
chatbot_gradio_app = gr.ChatInterface(
|
33 |
fn=predict_chatbot,
|
34 |
inputs=gr.Textbox(show_label=False, placeholder="Enter text and press enter"),
|
35 |
outputs=gr.Textbox(),
|
36 |
live=True,
|
37 |
+
title="Greta",
|
38 |
)
|
39 |
|
40 |
+
# Combine both interfaces into a single app
|
41 |
+
gr.TabbedInterface(
|
42 |
+
[image_gradio_app, chatbot_gradio_app],
|
43 |
+
tab_names=["image","chatbot"]
|
44 |
+
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|