Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -191,12 +191,17 @@ with gr.Blocks() as demo:
|
|
| 191 |
height=500
|
| 192 |
)
|
| 193 |
with gr.Column():
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
|
|
|
|
|
|
| 200 |
)
|
|
|
|
|
|
|
|
|
|
| 201 |
|
| 202 |
demo.launch()
|
|
|
|
| 191 |
height=500
|
| 192 |
)
|
| 193 |
with gr.Column():
|
| 194 |
+
# 创建一个文本输入框用于聊天
|
| 195 |
+
chat_input = gr.Textbox(placeholder="Type your message here...", label="Chat")
|
| 196 |
+
chat_output = gr.Textbox(label="Response", interactive=False)
|
| 197 |
+
|
| 198 |
+
# 示例组件,始终可见
|
| 199 |
+
examples = gr.Examples(
|
| 200 |
+
examples=['Top 10 prod_cate sales', 'Top product in category Seafood','sales trend of product name called lobster by time per day'],
|
| 201 |
+
inputs=chat_input
|
| 202 |
)
|
| 203 |
+
|
| 204 |
+
# 绑定 chat_input 的变化到 random_response 函数
|
| 205 |
+
chat_input.change(fn=random_response, inputs=chat_input, outputs=[chat_output, temp_img])
|
| 206 |
|
| 207 |
demo.launch()
|