satwikr commited on
Commit
e48a10a
·
verified ·
1 Parent(s): ec311db

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -64,14 +64,18 @@ def predict(message, history):
64
  # Define the Chatbot component and store it in a variable
65
  chatbot_component = gr.Chatbot(label="Business Advice from Jeff Bezos")
66
 
67
- demo = gr.Interface(
68
- fn=predict,
69
- inputs="text",
70
- outputs="text",
71
  title="Business Advice from Jeff Bezos",
72
- theme=gr.themes.Soft(),
73
- )
74
-
75
- demo.set_on_chat_load(__attachIp) # Attach IP handler
 
 
 
 
 
 
76
 
77
  demo.launch(debug=True)
 
64
  # Define the Chatbot component and store it in a variable
65
  chatbot_component = gr.Chatbot(label="Business Advice from Jeff Bezos")
66
 
67
+ with gr.ChatInterface(
68
+ predict,
 
 
69
  title="Business Advice from Jeff Bezos",
70
+ theme=gr.themes.Soft(),
71
+ chatbot=chatbot_component,
72
+ textbox=gr.Textbox(
73
+ placeholder="Ask Your Question",
74
+ scale=7,
75
+ max_lines=2,
76
+ )
77
+ ) as demo:
78
+ demo.load(None, None, chatbot_component) # Removed the reference to the undefined variable
79
+ demo.load(__attachIp, None, None)
80
 
81
  demo.launch(debug=True)