Tuchuanhuhuhu commited on
Commit
8d8013f
1 Parent(s): dfcde3a

修改:默认开启本地服务器,默认可以直接从IP访问,默认创建公开分享链接,加入页面标题

Browse files
Files changed (1) hide show
  1. ChuanhuChatbot.py +5 -2
ChuanhuChatbot.py CHANGED
@@ -179,8 +179,9 @@ def compose_user(user_input):
179
  def reset_textbox():
180
  return gr.update(value='')
181
 
182
-
183
  with gr.Blocks() as demo:
 
184
  keyTxt = gr.Textbox(show_label=True, placeholder=f"在这里输入你的OpenAI API-key...",
185
  value=my_api_key, label="API Key", type="password").style(container=True)
186
  chatbot = gr.Chatbot() # .style(color_map=("#1D51EE", "#585A5B"))
@@ -244,5 +245,7 @@ with gr.Blocks() as demo:
244
  refreshBtn.click(get_history_names, None, [uploadDropdown])
245
  uploadBtn.click(load_chat_history, [uploadDropdown], [saveFileName, systemPromptTxt, history, chatbot], show_progress=True)
246
 
 
247
 
248
- demo.queue().launch(debug=True)
 
 
179
  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...",
186
  value=my_api_key, label="API Key", type="password").style(container=True)
187
  chatbot = gr.Chatbot() # .style(color_map=("#1D51EE", "#585A5B"))
 
245
  refreshBtn.click(get_history_names, None, [uploadDropdown])
246
  uploadBtn.click(load_chat_history, [uploadDropdown], [saveFileName, systemPromptTxt, history, chatbot], show_progress=True)
247
 
248
+ print("川虎的温馨提示:访问 http://localhost:7860 查看界面")
249
 
250
+ # 默认开启本地服务器,默认可以直接从IP访问,默认创建公开分享链接
251
+ demo.queue().launch(server_name="0.0.0.0", server_port=7860, share=True)