mirror of
https://github.com/RYDE-WORK/Langchain-Chatchat.git
synced 2026-02-04 05:33:12 +08:00
update streamlit-aggrid; fix knowledge file status error (#4179)
This commit is contained in:
parent
7bec36e5b6
commit
af536a3309
@ -128,7 +128,7 @@ class KBFaissPool(_FaissPool):
|
||||
except Exception as e:
|
||||
if locked: # we don't know exception raised before or after atomic.release
|
||||
self.atomic.release()
|
||||
logger.error(e)
|
||||
logger.error(e, exc_info=True)
|
||||
raise RuntimeError(f"向量库 {kb_name} 加载失败。")
|
||||
return self.get((kb_name, vector_name))
|
||||
|
||||
|
||||
@ -206,6 +206,7 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
|
||||
]]
|
||||
doc_details["in_folder"] = doc_details["in_folder"].replace(True, "✓").replace(False, "×")
|
||||
doc_details["in_db"] = doc_details["in_db"].replace(True, "✓").replace(False, "×")
|
||||
print(doc_details)
|
||||
gb = config_aggrid(
|
||||
doc_details,
|
||||
{
|
||||
@ -217,8 +218,8 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
|
||||
("docs_count", "文档数量"): {},
|
||||
("text_splitter", "分词器"): {},
|
||||
# ("create_time", "创建时间"): {},
|
||||
("in_folder", "源文件"): {"cellRenderer": cell_renderer},
|
||||
("in_db", "向量库"): {"cellRenderer": cell_renderer},
|
||||
("in_folder", "源文件"): {},
|
||||
("in_db", "向量库"): {},
|
||||
},
|
||||
"multiple",
|
||||
)
|
||||
@ -236,7 +237,7 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
|
||||
)
|
||||
|
||||
selected_rows = doc_grid.get("selected_rows", [])
|
||||
|
||||
selected_rows = selected_rows.to_dict("records")
|
||||
cols = st.columns(4)
|
||||
file_name, file_path = file_exists(kb, selected_rows)
|
||||
if file_path:
|
||||
@ -330,6 +331,7 @@ def knowledge_base_page(api: ApiRequest, is_lite: bool = None):
|
||||
if selected_rows:
|
||||
file_name = selected_rows[0]["file_name"]
|
||||
docs = api.search_kb_docs(knowledge_base_name=selected_kb, file_name=file_name)
|
||||
|
||||
data = [
|
||||
{"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"),
|
||||
"type": x["type"],
|
||||
|
||||
@ -57,7 +57,7 @@ streamlit-option-menu = "0.3.12"
|
||||
streamlit-antd-components = "0.3.1"
|
||||
streamlit-chatbox = "1.1.12.post2"
|
||||
streamlit-modal = "0.1.0"
|
||||
streamlit-aggrid = "0.3.4.post3"
|
||||
streamlit-aggrid = "1.0.5"
|
||||
streamlit-extras = "0.4.2"
|
||||
xinference_client = { version = "^0.11.1", optional = true }
|
||||
zhipuai = { version = "^2.1.0", optional = true }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user