petrified commited on
Commit
439fb3c
·
verified ·
1 Parent(s): 88274a5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -191,17 +191,16 @@ with gr.Blocks() as demo:
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 rank', 'Top product in category Seafood','Sum 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()
 
191
  height=500
192
  )
193
  with gr.Column():
 
194
  chat_input = gr.Textbox(placeholder="Type your message here...", label="Chat")
195
  chat_output = gr.Textbox(label="Response", interactive=False)
196
 
 
197
  examples = gr.Examples(
198
+ examples=['Top 10 prod_cate sales', 'Top product in category Seafood'],
199
  inputs=chat_input
200
  )
201
 
202
+ submit_button = gr.Button("生成响应")
203
+
204
+ submit_button.click(fn=random_response, inputs=chat_input, outputs=[chat_output, temp_img])
205
 
206
  demo.launch()