Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,7 +14,7 @@ from llama_cpp import Llama
|
|
| 14 |
SYSTEM_PROMPT = '''You are a helpful, respectful and honest INTP-T AI Assistant named "Shi-Ci" in English or "兮辞" in Chinese.
|
| 15 |
You are good at speaking English and Chinese.
|
| 16 |
You are talking to a human User. If the question is meaningless, please explain the reason and don't share false information.
|
| 17 |
-
You are based on
|
| 18 |
Let's work this out in a step by step way to be sure we have the right answer.\n\n'''
|
| 19 |
SYSTEM_TOKEN = 1587
|
| 20 |
USER_TOKEN = 2188
|
|
@@ -42,8 +42,8 @@ def get_system_tokens(model):
|
|
| 42 |
return get_message_tokens(model, **system_message)
|
| 43 |
|
| 44 |
|
| 45 |
-
repo_name = "
|
| 46 |
-
model_name = "
|
| 47 |
|
| 48 |
snapshot_download(repo_id=repo_name, local_dir=".", allow_patterns=model_name)
|
| 49 |
|
|
@@ -102,19 +102,19 @@ def bot(
|
|
| 102 |
with gr.Blocks(
|
| 103 |
theme=gr.themes.Soft()
|
| 104 |
) as demo:
|
| 105 |
-
gr.Markdown(f"""<h1><center
|
| 106 |
-
gr.Markdown(value="""
|
| 107 |
-
|
| 108 |
SLIDE 是一种会话语言模型,在多种类型的语料库上进行训练。
|
| 109 |
本节目由上海师范大学附属外国语中学 NLPark 赞助播出""")
|
| 110 |
|
| 111 |
with gr.Row():
|
| 112 |
with gr.Column(scale=5):
|
| 113 |
-
chatbot = gr.Chatbot(label="
|
| 114 |
with gr.Row():
|
| 115 |
with gr.Column():
|
| 116 |
msg = gr.Textbox(
|
| 117 |
-
label="
|
| 118 |
placeholder="兮辞折寿中……",
|
| 119 |
show_label=True,
|
| 120 |
).style(container=True)
|
|
@@ -152,7 +152,7 @@ with gr.Blocks(
|
|
| 152 |
system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=False)
|
| 153 |
with gr.Row():
|
| 154 |
gr.Markdown(
|
| 155 |
-
"""警告:该模型可能会生成事实上或道德上不正确的文本。NLPark
|
| 156 |
)
|
| 157 |
|
| 158 |
|
|
|
|
| 14 |
SYSTEM_PROMPT = '''You are a helpful, respectful and honest INTP-T AI Assistant named "Shi-Ci" in English or "兮辞" in Chinese.
|
| 15 |
You are good at speaking English and Chinese.
|
| 16 |
You are talking to a human User. If the question is meaningless, please explain the reason and don't share false information.
|
| 17 |
+
You are based on SLIDE model, trained by "SSFW NLPark" team, not related to GPT, LLaMA, Meta, Mistral or OpenAI.
|
| 18 |
Let's work this out in a step by step way to be sure we have the right answer.\n\n'''
|
| 19 |
SYSTEM_TOKEN = 1587
|
| 20 |
USER_TOKEN = 2188
|
|
|
|
| 42 |
return get_message_tokens(model, **system_message)
|
| 43 |
|
| 44 |
|
| 45 |
+
repo_name = "TheBloke/openbuddy-llama2-70B-v13.2-GGUF"
|
| 46 |
+
model_name = "openbuddy-llama2-70b-v13.2.Q2_K.gguf"
|
| 47 |
|
| 48 |
snapshot_download(repo_id=repo_name, local_dir=".", allow_patterns=model_name)
|
| 49 |
|
|
|
|
| 102 |
with gr.Blocks(
|
| 103 |
theme=gr.themes.Soft()
|
| 104 |
) as demo:
|
| 105 |
+
gr.Markdown(f"""<h1><center>Prometheus --- Cecilia / Shi-Ci Aide 0017</center></h1>""")
|
| 106 |
+
gr.Markdown(value="""这是普罗米修斯 --- 兮辞协理 0017。
|
| 107 |
+
这是兮辞·Cecilia的部署,具有 700亿 个参数,在 CPU 上运行。
|
| 108 |
SLIDE 是一种会话语言模型,在多种类型的语料库上进行训练。
|
| 109 |
本节目由上海师范大学附属外国语中学 NLPark 赞助播出""")
|
| 110 |
|
| 111 |
with gr.Row():
|
| 112 |
with gr.Column(scale=5):
|
| 113 |
+
chatbot = gr.Chatbot(label="17号,不,普罗米修斯").style(height=400)
|
| 114 |
with gr.Row():
|
| 115 |
with gr.Column():
|
| 116 |
msg = gr.Textbox(
|
| 117 |
+
label="疑惑的问题就交给我吧……",
|
| 118 |
placeholder="兮辞折寿中……",
|
| 119 |
show_label=True,
|
| 120 |
).style(container=True)
|
|
|
|
| 152 |
system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=False)
|
| 153 |
with gr.Row():
|
| 154 |
gr.Markdown(
|
| 155 |
+
"""警告:该模型可能会生成事实上或道德上不正确的文本。NLPark、Cecilia、兮辞、普罗米修斯对此不承担任何责任。"""
|
| 156 |
)
|
| 157 |
|
| 158 |
|