paloma99 commited on
Commit
f718f04
1 Parent(s): bf8ddf1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -22
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.Interface(
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="Chatbot",
38
  )
39
 
40
- custom_html = """
41
- <style>
42
- body {
43
- background-color: #00ff00; /* Light green background */
44
- font-family: 'Arial', sans-serif; /* Modern sans-serif font */
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()