xu song commited on
Commit
73119ac
1 Parent(s): 726a01e
Files changed (2) hide show
  1. app.py +4 -7
  2. app_util.py +9 -0
app.py CHANGED
@@ -5,13 +5,7 @@ import gradio
5
  import config
6
  from app_util import *
7
 
8
- system_list = [
9
- "You are a helpful assistant.",
10
- "你是一个导游。",
11
- "你是一个英语老师。",
12
- "你是一个程序员。",
13
- "你是一个心理咨询师。",
14
- ]
15
 
16
  user_simulator_doc = """\
17
  There are maily two types of user simulator:
@@ -160,6 +154,9 @@ with gr.Blocks() as demo:
160
  slider_top_p.change(set_top_p, inputs=[slider_top_p])
161
  slider_top_k.change(set_top_k, inputs=[slider_top_k])
162
 
 
 
 
163
  # demo.queue().launch(share=False, server_name="0.0.0.0")
164
  # demo.queue().launch(concurrency_count=1, max_size=5)
165
  demo.queue().launch()
 
5
  import config
6
  from app_util import *
7
 
8
+
 
 
 
 
 
 
9
 
10
  user_simulator_doc = """\
11
  There are maily two types of user simulator:
 
154
  slider_top_p.change(set_top_p, inputs=[slider_top_p])
155
  slider_top_k.change(set_top_k, inputs=[slider_top_k])
156
 
157
+
158
+
159
+
160
  # demo.queue().launch(share=False, server_name="0.0.0.0")
161
  # demo.queue().launch(concurrency_count=1, max_size=5)
162
  demo.queue().launch()
app_util.py CHANGED
@@ -18,6 +18,15 @@ from models.cpp_qwen2 import bot
18
  #
19
  # gr.Chatbot.postprocess = postprocess
20
 
 
 
 
 
 
 
 
 
 
21
 
22
  def generate_user_message(chatbot, history):
23
  if history and history[-1]["role"] == "user":
 
18
  #
19
  # gr.Chatbot.postprocess = postprocess
20
 
21
+ system_list = [
22
+ "You are a helpful assistant.",
23
+ "你是一个导游。",
24
+ "你是一个英语老师。",
25
+ "你是一个程序员。",
26
+ "你是一个心理咨询师。",
27
+ ]
28
+
29
+ bot.pre_cache_system(system_list)
30
 
31
  def generate_user_message(chatbot, history):
32
  if history and history[-1]["role"] == "user":