Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -103,22 +103,30 @@ def bot(
|
|
103 |
history[-1][1] = partial_text
|
104 |
yield history
|
105 |
|
106 |
-
|
107 |
with gr.Blocks(
|
108 |
theme=gr.themes.Soft()
|
109 |
) as demo:
|
110 |
-
gr.Markdown(
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
)
|
118 |
with gr.Row():
|
119 |
with gr.Column(scale=5):
|
120 |
-
system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=False)
|
121 |
chatbot = gr.Chatbot(label="兮辞如是说").style(height=400)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
122 |
with gr.Column(min_width=80, scale=1):
|
123 |
with gr.Tab(label="设置参数"):
|
124 |
top_p = gr.Slider(
|
@@ -145,18 +153,8 @@ with gr.Blocks(
|
|
145 |
interactive=True,
|
146 |
label="情感温度"
|
147 |
)
|
148 |
-
with gr.Row():
|
149 |
with gr.Column():
|
150 |
-
|
151 |
-
label="来问问兮辞吧……",
|
152 |
-
placeholder="兮辞折寿中……",
|
153 |
-
show_label=False,
|
154 |
-
).style(container=False)
|
155 |
-
with gr.Column():
|
156 |
-
with gr.Row():
|
157 |
-
submit = gr.Button("开凹!")
|
158 |
-
stop = gr.Button("全局时空断裂")
|
159 |
-
clear = gr.Button("打扫群内垃圾")
|
160 |
with gr.Row():
|
161 |
gr.Markdown(
|
162 |
"""警告:该模型可能会生成事实上或道德上不正确的文本。NLPark和兮辞对此不承担任何责任。"""
|
|
|
103 |
history[-1][1] = partial_text
|
104 |
yield history
|
105 |
|
|
|
106 |
with gr.Blocks(
|
107 |
theme=gr.themes.Soft()
|
108 |
) as demo:
|
109 |
+
gr.Markdown(f"""<h1><center>上师附外-兮辞·CausalLM-人工智能助理</center></h1>""")
|
110 |
+
gr.Markdown(value="""欢迎使用!
|
111 |
+
这里是一个ChatBot。这是 CausalLM/14B 的部署,具有 140亿 个参数,正在 CPU 上运行。
|
112 |
+
CausalLM/14B 是一种会话语言模型,在多种类型的语料库上进行训练。
|
113 |
+
本节目由 JWorld & 上海师范大学附属外国语中学 NLPark 赞助播出
|
114 |
+
特别鸣谢 CausalLM 团队提供的如此优秀的模型,以及 TheBloke 提供的量化""")
|
115 |
+
|
|
|
116 |
with gr.Row():
|
117 |
with gr.Column(scale=5):
|
|
|
118 |
chatbot = gr.Chatbot(label="兮辞如是说").style(height=400)
|
119 |
+
with gr.Row():
|
120 |
+
with gr.Column():
|
121 |
+
msg = gr.Textbox(
|
122 |
+
label="来问问兮辞吧……",
|
123 |
+
placeholder="兮辞折寿中……",
|
124 |
+
show_label=True,
|
125 |
+
).style(container=True)
|
126 |
+
submit = gr.Button("Submit / 开凹!")
|
127 |
+
stop = gr.Button("Stop / 全局时空断裂")
|
128 |
+
clear = gr.Button("Clear / 打扫群内垃圾")
|
129 |
+
with gr.Row():
|
130 |
with gr.Column(min_width=80, scale=1):
|
131 |
with gr.Tab(label="设置参数"):
|
132 |
top_p = gr.Slider(
|
|
|
153 |
interactive=True,
|
154 |
label="情感温度"
|
155 |
)
|
|
|
156 |
with gr.Column():
|
157 |
+
system_prompt = gr.Textbox(label="系统提示词", placeholder="", value=SYSTEM_PROMPT, interactive=False)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
with gr.Row():
|
159 |
gr.Markdown(
|
160 |
"""警告:该模型可能会生成事实上或道德上不正确的文本。NLPark和兮辞对此不承担任何责任。"""
|