ehioko commited on
Commit
c531ca0
·
verified ·
1 Parent(s): 8df7382

fixing errors

Browse files
Files changed (1) hide show
  1. app.py +27 -14
app.py CHANGED
@@ -155,23 +155,36 @@ with gr.Blocks() as demo:
155
  label=None
156
  )
157
 
158
- with gr.Column(scale=3):
159
- # put your header image here
160
- gr.Image(value="Go Buddy2.png",
161
- interactive=False,
162
- show_label=False)
163
- # ChatInterface now takes all of those controls + the message/history
164
- chatbot = gr.ChatInterface(
165
- fn=respond,
166
- inputs=[use_spanish,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  destinations,
168
  season,
169
  luggage_types,
170
  luggage_size,
171
- food_prefs],
172
- type="messages",
173
- title="🌟 GoBuddy Chat",
174
- description="Your travel companion"
175
- )
176
 
177
  demo.launch(debug=True)
 
155
  label=None
156
  )
157
 
158
+ with gr.Column(scale=3):
159
+ gr.Image(value="header.png", interactive=False, show_label=False)
160
+
161
+ # 1) the chat history panel
162
+ chat_box = gr.Chatbot()
163
+
164
+ # 2) where the user types
165
+ msg = gr.Textbox(
166
+ placeholder="Ask me anything…",
167
+ label=None,
168
+ lines=1
169
+ )
170
+
171
+ # 3) send button
172
+ send_btn = gr.Button("Send")
173
+
174
+ # 4) hook up the click event
175
+ send_btn.click(
176
+ fn=respond,
177
+ inputs=[
178
+ msg, # the new message
179
+ chat_box, # past history
180
+ use_spanish,
181
  destinations,
182
  season,
183
  luggage_types,
184
  luggage_size,
185
+ food_prefs
186
+ ],
187
+ outputs=[chat_box, msg] # update history, clear the box
188
+ )
 
189
 
190
  demo.launch(debug=True)