Spaces:
Sleeping
Sleeping
fixing errors
Browse files
app.py
CHANGED
|
@@ -155,23 +155,36 @@ with gr.Blocks() as demo:
|
|
| 155 |
label=None
|
| 156 |
)
|
| 157 |
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 167 |
destinations,
|
| 168 |
season,
|
| 169 |
luggage_types,
|
| 170 |
luggage_size,
|
| 171 |
-
food_prefs
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
|
| 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)
|