wwpop commited on
Commit
ccf21d2
1 Parent(s): 87eac91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -38,11 +38,17 @@ def respond(
38
 
39
  response += token
40
  yield response
41
-
 
 
 
 
 
 
42
 
43
  demo = gr.ChatInterface(
44
  respond,
45
- examples=[["你好,你是谁?"], ["你是谁开发的?"]],
46
  cache_examples=False,
47
  title="千问2.5-72B",
48
  description="千问2.5-72B聊天机器人",
@@ -52,9 +58,10 @@ demo = gr.ChatInterface(
52
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
53
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
54
  ],
55
- chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True)
56
 
57
  )
58
 
59
  if __name__ == "__main__":
60
- demo.launch()
 
 
38
 
39
  response += token
40
  yield response
41
+
42
+ example_prompts = [
43
+ ["How to cook Kung Pao chicken the tastiest?"],
44
+ ["Help me create an email expressing my greetings to an old friend."],
45
+ ["写一篇关于青春的五言绝句"],
46
+ ["你是谁?"]
47
+ ]
48
 
49
  demo = gr.ChatInterface(
50
  respond,
51
+ examples=example_prompts,
52
  cache_examples=False,
53
  title="千问2.5-72B",
54
  description="千问2.5-72B聊天机器人",
 
58
  gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
59
  gr.Slider(minimum=0.1, maximum=1.0, value=0.95, step=0.05, label="Top-p (nucleus sampling)"),
60
  ],
61
+ chatbot=gr.Chatbot(show_label=True, show_share_button=False, show_copy_button=True)
62
 
63
  )
64
 
65
  if __name__ == "__main__":
66
+ demo.queue(default_concurrency_limit=40)
67
+ demo.launch(max_threads=40)