-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathui-chat.py
44 lines (37 loc) · 1.08 KB
/
ui-chat.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import gradio as gr
from repolya.chat import chat_predict_openai
from repolya._log import logger_chat
##### UI
_description = """
# Assistant
"""
with gr.Blocks(title=_description) as demo:
gr.Markdown(_description)
with gr.Tab(label = "Chat3.5"):
gr.ChatInterface(
fn=chat_predict_openai,
submit_btn="提交",
stop_btn="停止",
retry_btn="🔄 重试",
undo_btn="↩️ 撤消",
clear_btn="🗑️ 清除",
)
if __name__ == "__main__":
import sys
if len(sys.argv) > 1:
_port = int(sys.argv[1])
else:
_port = 7788
demo.queue(concurrency_count=1).launch(
server_name="0.0.0.0",
server_port=_port,
share=False,
favicon_path="./asset/favicon_assistant.png",
# auth = ('sz','1123'),
# auth_message= "欢迎回来!",
ssl_verify=False,
# ssl_keyfile="./localhost+2-key.pem",
# ssl_certfile="./localhost+2.pem",
# ssl_keyfile="./ssl/key.pem",
# ssl_certfile="./ssl/cert.pem",
)