willam9725712 commited on
Commit
5f35b54
·
1 Parent(s): bc0eac2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -2
app.py CHANGED
@@ -173,9 +173,9 @@ def predict(input,
173
 
174
  if __name__ == "__main__":
175
  block = gr.Blocks()
176
- with block as demo:
177
  gr.Markdown("<script language='javascript'>document.body.classList.toggle('dark');</script><div align='center' style='display: flex;flex-direction: row;'> \
178
- <div style='width:40%; flex: 1;padding: 10px;text-align: -webkit-right;'><img style='height:35px' src='https://300188.cn/templates/dist/img/l3.png'></div> \
179
  <div style='width:50%; margin-left: 10px; text-align: left;'><h2> Meiya GPT 美亚柏科大模型</span> </h2></div> \
180
  ")
181
  with gr.Row():
@@ -264,4 +264,14 @@ if __name__ == "__main__":
264
  1. 使用时请先上传自己的知识文件,并且文件中不含某些特殊字符,否则将返回error. <br>
265
  2. 有任何使用问题,请通过[问题交流区](https://huggingface.co/spaces/thomas-yanxin/LangChain-ChatLLM/discussions)或[Github Issue区](https://github.com/thomas-yanxin/LangChain-ChatGLM-Webui/issues)进行反馈. <br>
266
  """)
 
 
 
 
 
 
 
267
  demo.queue().launch(server_name='0.0.0.0', share=False)
 
 
 
 
173
 
174
  if __name__ == "__main__":
175
  block = gr.Blocks()
176
+ with block(analytics_enabled=False, theme='darkdefault',title='Meiya GPT大模型') as demo:
177
  gr.Markdown("<script language='javascript'>document.body.classList.toggle('dark');</script><div align='center' style='display: flex;flex-direction: row;'> \
178
+ <div style='width:40%; flex: 1;padding: 10px;text-align: -webkit-right;'><img style='height:35px' src='https://aigpt.sphq.cn/chat/meiya_logo_white.png'></div> \
179
  <div style='width:50%; margin-left: 10px; text-align: left;'><h2> Meiya GPT 美亚柏科大模型</span> </h2></div> \
180
  ")
181
  with gr.Row():
 
264
  1. 使用时请先上传自己的知识文件,并且文件中不含某些特殊字符,否则将返回error. <br>
265
  2. 有任何使用问题,请通过[问题交流区](https://huggingface.co/spaces/thomas-yanxin/LangChain-ChatLLM/discussions)或[Github Issue区](https://github.com/thomas-yanxin/LangChain-ChatGLM-Webui/issues)进行反馈. <br>
266
  """)
267
+
268
+ def auth(username, password):
269
+ if username == "admin" and password =="meiya":
270
+ return True
271
+ else:
272
+ return False
273
+
274
  demo.queue().launch(server_name='0.0.0.0', share=False)
275
+ demo.launch(share=False, auth=auth, debug=True, server_name='0.0.0.0', server_port=8006,auth_message="请输入用户名与密码")
276
+
277
+