littlebird13 commited on
Commit
d4c4e5c
1 Parent(s): f4c5c0a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -221,13 +221,13 @@ def _launch_demo(args):
221
  regen_btn = gr.Button("🤔️ Regenerate (重试)")
222
  empty_bin = gr.Button("🧹 Clear History (清除历史)")
223
 
224
- submit_btn.click(add_text, [chatbot, task_history, query], [chatbot, task_history]).then(
225
  predict, [chatbot, task_history], [chatbot], show_progress=True
226
  )
227
- submit_btn.click(reset_user_input, [], [query])
228
- empty_bin.click(reset_state, [task_history], [chatbot], show_progress=True)
229
- regen_btn.click(regenerate, [chatbot, task_history], [chatbot], show_progress=True)
230
- addfile_btn.upload(add_file, [chatbot, task_history, addfile_btn], [chatbot, task_history], show_progress=True)
231
 
232
  gr.Markdown("""\
233
  <font size=2>Note: This demo is governed by the original license of Qwen2-VL. \
@@ -236,8 +236,9 @@ including hate speech, violence, pornography, deception, etc. \
236
  (注:本演示受Qwen2-VL的许可协议限制。我们强烈建议,用户不应传播及不应允许他人传播以下内容,\
237
  包括但不限于仇恨言论、暴力、色情、欺诈相关的有害信息。)""")
238
 
239
- demo.queue().launch(
240
  share=args.share,
 
241
  # inbrowser=args.inbrowser,
242
  # server_port=args.server_port,
243
  # server_name=args.server_name,
 
221
  regen_btn = gr.Button("🤔️ Regenerate (重试)")
222
  empty_bin = gr.Button("🧹 Clear History (清除历史)")
223
 
224
+ submit_btn.click(add_text, [chatbot, task_history, query], [chatbot, task_history],concurrency_limit = 40).then(
225
  predict, [chatbot, task_history], [chatbot], show_progress=True
226
  )
227
+ submit_btn.click(reset_user_input, [], [query],concurrency_limit = 40)
228
+ empty_bin.click(reset_state, [task_history], [chatbot], show_progress=True,concurrency_limit = 40)
229
+ regen_btn.click(regenerate, [chatbot, task_history], [chatbot], show_progress=True,concurrency_limit = 40)
230
+ addfile_btn.upload(add_file, [chatbot, task_history, addfile_btn], [chatbot, task_history], show_progress=True,concurrency_limit = 40)
231
 
232
  gr.Markdown("""\
233
  <font size=2>Note: This demo is governed by the original license of Qwen2-VL. \
 
236
  (注:本演示受Qwen2-VL的许可协议限制。我们强烈建议,用户不应传播及不应允许他人传播以下内容,\
237
  包括但不限于仇恨言论、暴力、色情、欺诈相关的有害信息。)""")
238
 
239
+ demo.queue(api_open=False).launch(
240
  share=args.share,
241
+ max_threads=40,
242
  # inbrowser=args.inbrowser,
243
  # server_port=args.server_port,
244
  # server_name=args.server_name,