update webui.py

This commit is contained in:
imClumsyPanda 2023-05-10 23:21:36 +08:00
parent 9f07ead562
commit 264981e4b6
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ LLM_HISTORY_LEN = 3
# return top-k text chunk from vector store
VECTOR_SEARCH_TOP_K = 5
# 如果为0则不生效经测试小于500值的结果更精准
# 知识检索内容相关度 Score, 数值范围0-1000如果为0则不生效经测试设置为小于500时匹配结果更精准
VECTOR_SEARCH_SCORE_THRESHOLD = 0
NLTK_DATA_PATH = os.path.join(os.path.dirname(os.path.dirname(__file__)), "nltk_data")

View File

@ -57,7 +57,7 @@ def get_answer(query, vs_path, history, mode, score_threshold=VECTOR_SEARCH_SCOR
else:
source = "".join(
[
f"""<details> <summary>[score值]{doc.metadata["score"]} - {i + 1}[出处] {os.path.split(doc.metadata["source"])[-1]}</summary>\n"""
f"""<details> <summary>【出处{i + 1} {os.path.split(doc.metadata["source"])[-1]} - 【内容匹配相关度 Score】{doc.metadata["score"]}</summary>\n"""
f"""{doc.page_content}\n"""
f"""</details>"""
for i, doc in