Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -89,11 +89,11 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
89 |
cancelBtn = gr.Button("取消", variant="secondary", visible=False)
|
90 |
with gr.Row(scale=1):
|
91 |
emptyBtn = gr.Button(
|
92 |
-
"
|
93 |
)
|
94 |
-
retryBtn = gr.Button("
|
95 |
-
delLastBtn = gr.Button("
|
96 |
-
reduceTokenBtn = gr.Button("
|
97 |
|
98 |
with gr.Column():
|
99 |
with gr.Column(min_width=50, scale=1):
|
@@ -141,7 +141,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
141 |
value=get_template_names(plain=True)[0],
|
142 |
).style(container=False)
|
143 |
with gr.Column(scale=1):
|
144 |
-
templateRefreshBtn = gr.Button("
|
145 |
with gr.Row():
|
146 |
with gr.Column():
|
147 |
templateSelectDropdown = gr.Dropdown(
|
@@ -167,7 +167,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
167 |
value=get_history_names(plain=True)[0],
|
168 |
)
|
169 |
with gr.Column(scale=1):
|
170 |
-
historyRefreshBtn = gr.Button("
|
171 |
with gr.Row():
|
172 |
with gr.Column(scale=6):
|
173 |
saveFileName = gr.Textbox(
|
@@ -177,8 +177,8 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
177 |
value="对话历史记录",
|
178 |
).style(container=True)
|
179 |
with gr.Column(scale=1):
|
180 |
-
saveHistoryBtn = gr.Button("
|
181 |
-
exportMarkdownBtn = gr.Button("
|
182 |
gr.Markdown("默认保存于history文件夹")
|
183 |
with gr.Row():
|
184 |
with gr.Column():
|
@@ -186,7 +186,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
186 |
|
187 |
with gr.Tab(label="高级"):
|
188 |
gr.Markdown("# ⚠️ 务必谨慎更改 ⚠️\n\n如果无法使用请恢复默认设置")
|
189 |
-
default_btn = gr.Button("
|
190 |
|
191 |
with gr.Accordion("参数", open=False):
|
192 |
top_p = gr.Slider(
|
@@ -214,7 +214,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
214 |
value="https://api.openai.com/v1/chat/completions",
|
215 |
lines=2,
|
216 |
)
|
217 |
-
changeAPIURLBtn = gr.Button("
|
218 |
proxyTxt = gr.Textbox(
|
219 |
show_label=True,
|
220 |
placeholder=f"在这里输入代理地址...",
|
@@ -222,7 +222,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
|
|
222 |
value="",
|
223 |
lines=2,
|
224 |
)
|
225 |
-
changeProxyBtn = gr.Button("
|
226 |
|
227 |
gr.Markdown(description)
|
228 |
|
@@ -400,7 +400,7 @@ logging.info(
|
|
400 |
+ colorama.Style.RESET_ALL
|
401 |
)
|
402 |
# 默认开启本地服务器,默认可以直接从IP访问,默认不创建公开分享链接
|
403 |
-
demo.title = "
|
404 |
|
405 |
if __name__ == "__main__":
|
406 |
reload_javascript()
|
|
|
89 |
cancelBtn = gr.Button("取消", variant="secondary", visible=False)
|
90 |
with gr.Row(scale=1):
|
91 |
emptyBtn = gr.Button(
|
92 |
+
"新的对话",
|
93 |
)
|
94 |
+
retryBtn = gr.Button("重新生成")
|
95 |
+
delLastBtn = gr.Button("删除一条对话")
|
96 |
+
reduceTokenBtn = gr.Button("总结对话")
|
97 |
|
98 |
with gr.Column():
|
99 |
with gr.Column(min_width=50, scale=1):
|
|
|
141 |
value=get_template_names(plain=True)[0],
|
142 |
).style(container=False)
|
143 |
with gr.Column(scale=1):
|
144 |
+
templateRefreshBtn = gr.Button("刷新")
|
145 |
with gr.Row():
|
146 |
with gr.Column():
|
147 |
templateSelectDropdown = gr.Dropdown(
|
|
|
167 |
value=get_history_names(plain=True)[0],
|
168 |
)
|
169 |
with gr.Column(scale=1):
|
170 |
+
historyRefreshBtn = gr.Button("刷新")
|
171 |
with gr.Row():
|
172 |
with gr.Column(scale=6):
|
173 |
saveFileName = gr.Textbox(
|
|
|
177 |
value="对话历史记录",
|
178 |
).style(container=True)
|
179 |
with gr.Column(scale=1):
|
180 |
+
saveHistoryBtn = gr.Button("保存对话")
|
181 |
+
exportMarkdownBtn = gr.Button("导出为Markdown")
|
182 |
gr.Markdown("默认保存于history文件夹")
|
183 |
with gr.Row():
|
184 |
with gr.Column():
|
|
|
186 |
|
187 |
with gr.Tab(label="高级"):
|
188 |
gr.Markdown("# ⚠️ 务必谨慎更改 ⚠️\n\n如果无法使用请恢复默认设置")
|
189 |
+
default_btn = gr.Button("恢复默认设置")
|
190 |
|
191 |
with gr.Accordion("参数", open=False):
|
192 |
top_p = gr.Slider(
|
|
|
214 |
value="https://api.openai.com/v1/chat/completions",
|
215 |
lines=2,
|
216 |
)
|
217 |
+
changeAPIURLBtn = gr.Button("切换API地址")
|
218 |
proxyTxt = gr.Textbox(
|
219 |
show_label=True,
|
220 |
placeholder=f"在这里输入代理地址...",
|
|
|
222 |
value="",
|
223 |
lines=2,
|
224 |
)
|
225 |
+
changeProxyBtn = gr.Button("设置代理地址")
|
226 |
|
227 |
gr.Markdown(description)
|
228 |
|
|
|
400 |
+ colorama.Style.RESET_ALL
|
401 |
)
|
402 |
# 默认开启本地服务器,默认可以直接从IP访问,默认不创建公开分享链接
|
403 |
+
demo.title = "ChatGPT for BAI Innovation"
|
404 |
|
405 |
if __name__ == "__main__":
|
406 |
reload_javascript()
|