update knowledge_base and dialogue page of webui

This commit is contained in:
imClumsyPanda 2023-09-15 13:45:47 +08:00
parent eb49a91190
commit a87a2815da
14 changed files with 16 additions and 12 deletions

View File

@ -361,11 +361,11 @@ CUDA_VISIBLE_DEVICES=0,1 python startup.py -a
- Web UI 对话界面:
![img](img/webui_0813_0.png)
![img](img/webui_0915_0.png)
- Web UI 知识库管理页面:
![](img/webui_0813_1.png)
![](img/webui_0915_1.png)
---

View File

@ -300,10 +300,13 @@ The API, chat interface of WebUI, and knowledge management interface of WebUI ar
2. Chat Interface of WebUI
![img](img/webui_0813_0.png)
- Dialogue interface of WebUI
![img](img/webui_0915_0.png)
- Knowledge management interface of WebUI
![img](img/webui_0813_1.png)
![img](img/webui_0915_1.png)
### 6 Luanching API Service or WebUI step-by-step

View File

@ -1,4 +1,4 @@
from .model_config import *
from .server_config import *
VERSION = "v0.2.4-preview"
VERSION = "v0.2.4"

View File

@ -203,13 +203,13 @@ DEFAULT_VS_TYPE = "faiss"
CACHED_VS_NUM = 1
# 知识库匹配向量数量
VECTOR_SEARCH_TOP_K = 5
VECTOR_SEARCH_TOP_K = 3
# 知识库匹配相关度阈值取值范围在0-1之间SCORE越小相关度越高取到1相当于不筛选建议设置在0.5左右
SCORE_THRESHOLD = 1
# 搜索引擎匹配结题数量
SEARCH_ENGINE_TOP_K = 5
SEARCH_ENGINE_TOP_K = 3
# nltk 模型存储路径
NLTK_DATA_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "nltk_data")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 326 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 249 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

BIN
img/webui_0915_0.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 KiB

BIN
img/webui_0915_1.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

View File

@ -60,6 +60,7 @@ def dialogue_page(api: ApiRequest):
"知识库问答",
"搜索引擎问答",
],
index=1,
on_change=on_mode_change,
key="dialogue_mode",
)
@ -95,7 +96,7 @@ def dialogue_page(api: ApiRequest):
r = api.change_llm_model(st.session_state.get("prev_llm_model"), llm_model)
st.session_state["cur_llm_model"] = llm_model
temperature = st.number_input("Temperature", 0.0, 1.0, TEMPERATURE, 0.05)
temperature = st.slider("Temperature", 0.0, 1.0, TEMPERATURE, 0.05)
history_len = st.number_input("历史对话轮数:", 0, 10, HISTORY_LEN)
def on_kb_change():
@ -111,7 +112,7 @@ def dialogue_page(api: ApiRequest):
key="selected_kb",
)
kb_top_k = st.number_input("匹配知识条数:", 1, 20, VECTOR_SEARCH_TOP_K)
score_threshold = st.number_input("知识匹配分数阈值:", 0.0, 1.0, float(SCORE_THRESHOLD), 0.01)
score_threshold = st.slider("知识匹配分数阈值:", 0.0, 1.0, float(SCORE_THRESHOLD), 0.01)
# chunk_content = st.checkbox("关联上下文", False, disabled=True)
# chunk_size = st.slider("关联长度:", 0, 500, 250, disabled=True)
elif dialogue_mode == "搜索引擎问答":

View File

@ -142,7 +142,7 @@ def knowledge_base_page(api: ApiRequest):
):
cols = st.columns(3)
chunk_size = cols[0].number_input("单段文本最大长度:", 1, 1000, CHUNK_SIZE)
chunk_overlap = cols[1].number_input("相邻文本重合长度:", 0, 500, OVERLAP_SIZE)
chunk_overlap = cols[1].number_input("相邻文本重合长度:", 0, chunk_size, OVERLAP_SIZE)
cols[2].write("")
cols[2].write("")
zh_title_enhance = cols[2].checkbox("开启中文标题加强", ZH_TITLE_ENHANCE)