修改智谱API默认名称,给WEBUI设置主题 (#1484)

* 給WEBUI设置主题

* chatglm-api更名为zhipu-api
This commit is contained in:
liunux4odoo 2023-09-15 01:48:02 +08:00 committed by GitHub
parent f0f1dc2537
commit 30aeec1c45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 10 additions and 5 deletions

View File

@ -82,7 +82,7 @@ llm_model_dict = {
# 如果没有设置有效的local_model_path则认为是在线模型API。 # 如果没有设置有效的local_model_path则认为是在线模型API。
# 请在server_config中为每个在线API设置不同的端口 # 请在server_config中为每个在线API设置不同的端口
# 具体注册及api key获取请前往 http://open.bigmodel.cn # 具体注册及api key获取请前往 http://open.bigmodel.cn
"chatglm-api": { "zhipu-api": {
"api_base_url": "http://127.0.0.1:8888/v1", "api_base_url": "http://127.0.0.1:8888/v1",
"api_key": "", "api_key": "",
"provider": "ChatGLMWorker", "provider": "ChatGLMWorker",

View File

@ -64,7 +64,7 @@ FSCHAT_MODEL_WORKERS = {
"baichuan-7b": { # 使用default中的IP和端口 "baichuan-7b": { # 使用default中的IP和端口
"device": "cpu", "device": "cpu",
}, },
"chatglm-api": { # 请为每个在线API设置不同的端口 "zhipu-api": { # 请为每个在线API设置不同的端口
"port": 20003, "port": 20003,
}, },
"minimax-api": { # 请为每个在线API设置不同的端口 "minimax-api": { # 请为每个在线API设置不同的端口

View File

@ -12,7 +12,7 @@ class ChatGLMWorker(ApiModelWorker):
def __init__( def __init__(
self, self,
*, *,
model_names: List[str] = ["chatglm-api"], model_names: List[str] = ["zhipu-api"],
version: Literal["chatglm_pro", "chatglm_std", "chatglm_lite"] = "chatglm_std", version: Literal["chatglm_pro", "chatglm_std", "chatglm_lite"] = "chatglm_std",
controller_addr: str, controller_addr: str,
worker_addr: str, worker_addr: str,

View File

@ -360,7 +360,12 @@ def run_webui(started_event: mp.Event = None):
p = subprocess.Popen(["streamlit", "run", "webui.py", p = subprocess.Popen(["streamlit", "run", "webui.py",
"--server.address", host, "--server.address", host,
"--server.port", str(port)]) "--server.port", str(port),
"--theme.base", "light",
"--theme.primaryColor", "#165dff",
"--theme.secondaryBackgroundColor", "#f5f5f5",
"--theme.textColor", "#000000",
])
started_event.set() started_event.set()
p.wait() p.wait()

View File

@ -130,7 +130,7 @@ def knowledge_base_page(api: ApiRequest):
with st.sidebar: with st.sidebar:
chunk_size = st.number_input("单段文本最大长度:", 1, 1000, CHUNK_SIZE) chunk_size = st.number_input("单段文本最大长度:", 1, 1000, CHUNK_SIZE)
chunk_overlap = st.number_input("相邻文本重合长度:", 0, 500, OVERLAP_SIZE) chunk_overlap = st.number_input("相邻文本重合长度:", 0, 500, OVERLAP_SIZE)
zh_title_enhance = st.checkbox("开启中文标题加强", ZH_TITLE_ENHANCE) zh_title_enhance = st.checkbox("开启中文标题加强", ZH_TITLE_ENHANCE)
# 上传文件 # 上传文件
files = st.file_uploader("上传知识文件:", files = st.file_uploader("上传知识文件:",