Spaces:
Sleeping
Sleeping
Tuchuanhuhuhu
commited on
Commit
•
f744196
1
Parent(s):
8d8013f
修改:完善页面标题
Browse files- ChuanhuChatbot.py +14 -3
ChuanhuChatbot.py
CHANGED
@@ -180,6 +180,15 @@ def reset_textbox():
|
|
180 |
return gr.update(value='')
|
181 |
|
182 |
title = """<h1 align="center">川虎ChatGPT 🚀</h1>"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
183 |
with gr.Blocks() as demo:
|
184 |
gr.HTML(title)
|
185 |
keyTxt = gr.Textbox(show_label=True, placeholder=f"在这里输入你的OpenAI API-key...",
|
@@ -225,6 +234,8 @@ with gr.Blocks() as demo:
|
|
225 |
step=0.1, interactive=True, label="Temperature",)
|
226 |
#top_k = gr.Slider( minimum=1, maximum=50, value=4, step=1, interactive=True, label="Top-k",)
|
227 |
#repetition_penalty = gr.Slider( minimum=0.1, maximum=3.0, value=1.03, step=0.01, interactive=True, label="Repetition Penalty", )
|
|
|
|
|
228 |
|
229 |
txt.submit(predict, [txt, top_p, temperature, keyTxt,
|
230 |
chatbot, history, systemPromptTxt], [chatbot, history])
|
@@ -246,6 +257,6 @@ with gr.Blocks() as demo:
|
|
246 |
uploadBtn.click(load_chat_history, [uploadDropdown], [saveFileName, systemPromptTxt, history, chatbot], show_progress=True)
|
247 |
|
248 |
print("川虎的温馨提示:访问 http://localhost:7860 查看界面")
|
249 |
-
|
250 |
-
|
251 |
-
demo.queue().launch(server_name="
|
|
|
180 |
return gr.update(value='')
|
181 |
|
182 |
title = """<h1 align="center">川虎ChatGPT 🚀</h1>"""
|
183 |
+
description = """<div align=center>
|
184 |
+
|
185 |
+
由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536) 开发
|
186 |
+
|
187 |
+
访问川虎ChatGPT的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本
|
188 |
+
|
189 |
+
此App使用 `gpt-3.5-turbo` 大语言模型
|
190 |
+
</div>
|
191 |
+
"""
|
192 |
with gr.Blocks() as demo:
|
193 |
gr.HTML(title)
|
194 |
keyTxt = gr.Textbox(show_label=True, placeholder=f"在这里输入你的OpenAI API-key...",
|
|
|
234 |
step=0.1, interactive=True, label="Temperature",)
|
235 |
#top_k = gr.Slider( minimum=1, maximum=50, value=4, step=1, interactive=True, label="Top-k",)
|
236 |
#repetition_penalty = gr.Slider( minimum=0.1, maximum=3.0, value=1.03, step=0.01, interactive=True, label="Repetition Penalty", )
|
237 |
+
gr.Markdown(description)
|
238 |
+
|
239 |
|
240 |
txt.submit(predict, [txt, top_p, temperature, keyTxt,
|
241 |
chatbot, history, systemPromptTxt], [chatbot, history])
|
|
|
257 |
uploadBtn.click(load_chat_history, [uploadDropdown], [saveFileName, systemPromptTxt, history, chatbot], show_progress=True)
|
258 |
|
259 |
print("川虎的温馨提示:访问 http://localhost:7860 查看界面")
|
260 |
+
# 默认开启本地服务器,默认可以直接从IP访问,默认不创建公开分享链接
|
261 |
+
demo.title = "川虎ChatGPT 🚀"
|
262 |
+
demo.queue().launch(server_name="127.0.0.1", server_port=7860, share=False) # 改为 share=True 可以创建公开分享链接
|