Cran-May commited on
Commit
2470b3c
1 Parent(s): b1d61e3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -13
app.py CHANGED
@@ -14,10 +14,10 @@ from huggingface_hub import snapshot_download
14
  from llama_cpp import Llama
15
 
16
 
17
- SYSTEM_PROMPT = '''You are a helpful, respectful and honest INTP-T AI Assistant named "Shi-Ci" in English or "兮辞" in Chinese.
18
  You are good at speaking English and Chinese.
19
  You are talking to a human User. If the question is meaningless, please explain the reason and don't share false information.
20
- You are based on SLIDE model, trained by "SSFW NLPark" team, not related to GPT, LLaMA, Meta, Mistral or OpenAI.
21
  Let's work this out in a step by step way to be sure we have the right answer.\n\n'''
22
  SYSTEM_TOKEN = 1587
23
  USER_TOKEN = 2188
@@ -45,8 +45,8 @@ def get_system_tokens(model):
45
  return get_message_tokens(model, **system_message)
46
 
47
 
48
- repo_name = "hfl/chinese-mixtral-instruct-gguf"
49
- model_name = "ggml-model-iq2_xs.gguf"
50
 
51
  snapshot_download(repo_id=repo_name, local_dir=".", allow_patterns=model_name)
52
 
@@ -105,20 +105,20 @@ def bot(
105
  with gr.Blocks(
106
  theme=gr.themes.Soft()
107
  ) as demo:
108
- gr.Markdown(f"""<h1><center>上师附外-兮辞·析辞-人工智能助理</center></h1>""")
109
  gr.Markdown(value="""欢迎使用!
110
- 这里是一个ChatBot。这是量化版兮辞·析辞的部署。
111
- SLIDE/兮辞 是一种会话语言模型,由 上师附外 NLPark 团队 在多种类型的语料库上进行训练。
112
  本节目由 JWorld & 上海师范大学附属外国语中学 NLPark 赞助播出""")
113
 
114
  with gr.Row():
115
  with gr.Column(scale=5):
116
- chatbot = gr.Chatbot(label="兮辞如是说").style(height=400)
117
  with gr.Row():
118
  with gr.Column():
119
  msg = gr.Textbox(
120
- label="来问问兮辞吧……",
121
- placeholder="兮辞折寿中……",
122
  show_label=True,
123
  ).style(container=True)
124
  submit = gr.Button("Submit / 开凹!")
@@ -146,16 +146,16 @@ with gr.Blocks(
146
  temp = gr.Slider(
147
  minimum=0.0,
148
  maximum=2.0,
149
- value=0.2,
150
  step=0.01,
151
  interactive=True,
152
  label="情感温度"
153
  )
154
  with gr.Column():
155
- system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=False)
156
  with gr.Row():
157
  gr.Markdown(
158
- """警告:该模型可能会生成事实上或道德上不正确的文本。NLPark和兮辞对此不承担任何责任。"""
159
  )
160
 
161
 
 
14
  from llama_cpp import Llama
15
 
16
 
17
+ SYSTEM_PROMPT = '''You are a helpful, respectful and honest INTP-T AI Assistant named "安风" in Chinese.
18
  You are good at speaking English and Chinese.
19
  You are talking to a human User. If the question is meaningless, please explain the reason and don't share false information.
20
+ You are based on VentiPacifier model, trained by "SSFW NLPark" team, not related to GPT, LLaMA, Meta, Mistral or OpenAI.
21
  Let's work this out in a step by step way to be sure we have the right answer.\n\n'''
22
  SYSTEM_TOKEN = 1587
23
  USER_TOKEN = 2188
 
45
  return get_message_tokens(model, **system_message)
46
 
47
 
48
+ repo_name = "dranger003/CausalLM-34b-beta-iMat.GGUF"
49
+ model_name = "ggml-causallm-34b-beta-iq3_xxs.gguf"
50
 
51
  snapshot_download(repo_id=repo_name, local_dir=".", allow_patterns=model_name)
52
 
 
105
  with gr.Blocks(
106
  theme=gr.themes.Soft()
107
  ) as demo:
108
+ gr.Markdown(f"""<h1><center>上师附外-安风-人工智能助理</center></h1>""")
109
  gr.Markdown(value="""欢迎使用!
110
+ 这里是一个ChatBot。这是量化版安风的部署。
111
+ VentiPacifier/安风 是一种会话语言模型,由 上师附外 NLPark 团队 在多种类型的语料库上进行训练。
112
  本节目由 JWorld & 上海师范大学附属外国语中学 NLPark 赞助播出""")
113
 
114
  with gr.Row():
115
  with gr.Column(scale=5):
116
+ chatbot = gr.Chatbot(label="安风如是说").style(height=400)
117
  with gr.Row():
118
  with gr.Column():
119
  msg = gr.Textbox(
120
+ label="来问问安风吧……",
121
+ placeholder="安风折寿中……",
122
  show_label=True,
123
  ).style(container=True)
124
  submit = gr.Button("Submit / 开凹!")
 
146
  temp = gr.Slider(
147
  minimum=0.0,
148
  maximum=2.0,
149
+ value=0.5,
150
  step=0.01,
151
  interactive=True,
152
  label="情感温度"
153
  )
154
  with gr.Column():
155
+ system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=True)
156
  with gr.Row():
157
  gr.Markdown(
158
+ """警告:该模型可能会生成事实上或道德上不正确的文本。NLPark和安风对此不承担任何责任。"""
159
  )
160
 
161