JohnSmith9982 commited on
Commit
230c8d1
1 Parent(s): 9b6bf93

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -158,14 +158,14 @@ with gr.Blocks() as demo:
158
  reduceTokenBtn = gr.Button("♻️ 优化Tokens")
159
  newSystemPrompt = gr.Textbox(show_label=True, placeholder=f"在这里输入新的System Prompt...", label="更改 System prompt").style(container=True)
160
  systemPromptDisplay = gr.Textbox(show_label=True, value=initial_prompt, interactive=False, label="目前的 System prompt").style(container=True)
161
- with gr.Accordion(label="保存/加载对话历史记录(在文本框中输入文件名,点击“保存对话”按钮,历史记录文件会被存储到本地)", open=False):
162
- with gr.Column():
163
- with gr.Row():
164
- with gr.Column(scale=6):
165
- saveFileName = gr.Textbox(show_label=True, placeholder=f"在这里输入保存的文件名...", label="保存对话", value="对话历史记录").style(container=True)
166
- with gr.Column(scale=1):
167
- saveBtn = gr.Button("💾 保存对话")
168
- uploadBtn = gr.UploadButton("📂 读取对话", file_count="single", file_types=["json"])
169
 
170
  txt.submit(predict, [chatbot, txt, systemPrompt, context, myKey], [chatbot, context], show_progress=True)
171
  txt.submit(lambda :"", None, txt)
@@ -179,8 +179,8 @@ with gr.Blocks() as demo:
179
  delLastBtn.click(delete_last_conversation, [chatbot, context], [chatbot, context], show_progress=True)
180
  reduceTokenBtn.click(reduce_token, [chatbot, systemPrompt, context, myKey], [chatbot, context], show_progress=True)
181
  keyTxt.submit(set_apikey, [keyTxt, myKey], [keyTxt, myKey], show_progress=True)
182
- uploadBtn.upload(load_chat_history, uploadBtn, [chatbot, systemPrompt, context, systemPromptDisplay], show_progress=True)
183
- saveBtn.click(save_chat_history, [saveFileName, systemPrompt, context], None, show_progress=True)
184
 
185
 
186
  demo.launch()
 
158
  reduceTokenBtn = gr.Button("♻️ 优化Tokens")
159
  newSystemPrompt = gr.Textbox(show_label=True, placeholder=f"在这里输入新的System Prompt...", label="更改 System prompt").style(container=True)
160
  systemPromptDisplay = gr.Textbox(show_label=True, value=initial_prompt, interactive=False, label="目前的 System prompt").style(container=True)
161
+ # with gr.Accordion(label="保存/加载对话历史记录(在文本框中输入文件名,点击“保存对话”按钮,历史记录文件会被存储到本地)", open=False):
162
+ # with gr.Column():
163
+ # with gr.Row():
164
+ # with gr.Column(scale=6):
165
+ # saveFileName = gr.Textbox(show_label=True, placeholder=f"在这里输入保存的文件名...", label="保存对话", value="对话历史记录").style(container=True)
166
+ # with gr.Column(scale=1):
167
+ # saveBtn = gr.Button("💾 保存对话")
168
+ # uploadBtn = gr.UploadButton("📂 读取对话", file_count="single", file_types=["json"])
169
 
170
  txt.submit(predict, [chatbot, txt, systemPrompt, context, myKey], [chatbot, context], show_progress=True)
171
  txt.submit(lambda :"", None, txt)
 
179
  delLastBtn.click(delete_last_conversation, [chatbot, context], [chatbot, context], show_progress=True)
180
  reduceTokenBtn.click(reduce_token, [chatbot, systemPrompt, context, myKey], [chatbot, context], show_progress=True)
181
  keyTxt.submit(set_apikey, [keyTxt, myKey], [keyTxt, myKey], show_progress=True)
182
+ # uploadBtn.upload(load_chat_history, uploadBtn, [chatbot, systemPrompt, context, systemPromptDisplay], show_progress=True)
183
+ # saveBtn.click(save_chat_history, [saveFileName, systemPrompt, context], None, show_progress=True)
184
 
185
 
186
  demo.launch()