Langchain-Chatchat icon indicating copy to clipboard operation
Langchain-Chatchat copied to clipboard

当我尝试向数据库添加文档出现以下错误

Open cstkn opened this issue 11 months ago • 3 comments

2024-03-02 10:40:59,781 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51231 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:40:59,782 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" 2024-03-02 10:41:00,032 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51231 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:00,034 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51231 - "POST /llm_model/list_config_models HTTP/1.1" 200 OK 2024-03-02 10:41:00,046 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_config_models "HTTP/1.1 200 OK" 2024-03-02 10:41:16,824 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51244 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:16,826 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" 2024-03-02 10:41:16,990 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51244 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:16,992 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51244 - "POST /llm_model/list_config_models HTTP/1.1" 200 OK 2024-03-02 10:41:17,002 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_config_models "HTTP/1.1 200 OK" 2024-03-02 10:41:17.003 Please replace st.experimental_rerun with st.rerun.

st.experimental_rerun will be removed after 2024-04-01. 2024-03-02 10:41:17,435 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51247 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:17,438 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" 2024-03-02 10:41:17,606 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51247 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:17,606 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51247 - "POST /llm_model/list_config_models HTTP/1.1" 200 OK 2024-03-02 10:41:17,615 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_config_models "HTTP/1.1 200 OK" 2024-03-02 10:41:22,742 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51254 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:22,744 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" 2024-03-02 10:41:22.745 Please replace st.experimental_rerun with st.rerun.

st.experimental_rerun will be removed after 2024-04-01. 2024-03-02 10:41:23,177 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51258 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:23,179 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" 2024-03-02 10:41:23,344 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:20001/list_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51258 - "POST /llm_model/list_running_models HTTP/1.1" 200 OK 2024-03-02 10:41:23,346 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_running_models "HTTP/1.1 200 OK" INFO: 127.0.0.1:51258 - "POST /llm_model/list_config_models HTTP/1.1" 200 OK 2024-03-02 10:41:23,361 - _client.py[line:1027] - INFO: HTTP Request: POST http://127.0.0.1:7861/llm_model/list_config_models "HTTP/1.1 200 OK" 2024-03-02 10:41:32,106 - faiss_cache.py[line:92] - INFO: loading vector store in 'samples/vector_store/bge-large-zh-v1.5' from disk. 2024-03-02 10:41:32,106 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: BAAI/bge-large-zh-v1.5 2024-03-02 10:41:38,327 - utils.py[line:95] - ERROR: ReadError: error when post /knowledge_base/search_docs: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 2024-03-02 10:41:38,327 - utils.py[line:95] - ERROR: ReadError: error when post /knowledge_base/search_docs: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 2024-03-02 10:41:38,327 - utils.py[line:95] - ERROR: ReadError: error when post /knowledge_base/search_docs: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 2024-03-02 10:41:40,352 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:40,352 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:40,352 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:42,373 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:42,373 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:42,373 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:42.373 Uncaught app exception Traceback (most recent call last): File "D:\wujiaping\chatglm.venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "D:\wujiaping\chatglm\Langchain-Chatchat\webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 328, in knowledge_base_page data = [ ^ File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 329, in {"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"), ~^^^^^^ TypeError: string indices must be integers, not 'str' 2024-03-02 10:41:42.373 Uncaught app exception Traceback (most recent call last): File "D:\wujiaping\chatglm.venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "D:\wujiaping\chatglm\Langchain-Chatchat\webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 328, in knowledge_base_page data = [ ^ File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 329, in {"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"), ~^^^^^^ TypeError: string indices must be integers, not 'str' 2024-03-02 10:41:42.373 Uncaught app exception Traceback (most recent call last): File "D:\wujiaping\chatglm.venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "D:\wujiaping\chatglm\Langchain-Chatchat\webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 328, in knowledge_base_page data = [ ^ File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 329, in {"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"), ~^^^^^^ TypeError: string indices must be integers, not 'str' 2024-03-02 10:41:47,594 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:49,623 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:51,658 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/search_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。 2024-03-02 10:41:51.658 Uncaught app exception Traceback (most recent call last): File "D:\wujiaping\chatglm.venv\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 535, in _run_script exec(code, module.dict) File "D:\wujiaping\chatglm\Langchain-Chatchat\webui.py", line 64, in pages[selected_page]["func"](api=api, is_lite=is_lite) File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 328, in knowledge_base_page data = [ ^ File "D:\wujiaping\chatglm\langchain-chatchat\webui_pages\knowledge_base\knowledge_base.py", line 329, in {"seq": i + 1, "id": x["id"], "page_content": x["page_content"], "source": x["metadata"].get("source"), ~^^^^^^ TypeError: string indices must be integers, not 'str'

cstkn avatar Mar 02 '24 02:03 cstkn

Hey there, @cstkn! Long time no chat. Hope you're doing well amidst all these tech gremlins.

Based on the context provided, it seems like you're encountering a few different issues. Let's address them one by one:

  1. "st.experimental_rerun" Deprecation Warning: This warning is due to the use of an outdated Streamlit function. As per the latest Streamlit documentation, you should replace st.experimental_rerun with st.rerun. This change should resolve the deprecation warning.

  2. "ReadError" and "ConnectError" when posting to /knowledge_base/search_docs: These errors typically indicate network connectivity issues or problems with the server handling the requests. For the "ConnectError", ensure that the server you're trying to connect to is up and running and that your network connection is stable. For the "ReadError", it might indicate a timeout or an issue with the server's response. Ensure the server is correctly handling the requests and not timing out.

  3. "TypeError" indicating string indices must be integers, not 'str': This error usually occurs when you're trying to access elements of a string using string indices instead of integers. In the context of your code, this error might be related to how you're handling the response data or the data you're sending in your requests. Ensure that when you're accessing elements of a response or a data structure, you're using the correct data types for indices.

In addition to these solutions, I found a similar issue in the Langchain-Chatchat repository: 自定义知识库 上传、删除等报错. The suggested solution for this issue was to update the project code and dependencies, especially langchain/fschat, and then try again.

Lastly, the exact version of Streamlit being used in the Langchain-Chatchat repository is 1.30.0 as per the requirements_webui.txt file.

I hope this helps! If you need further assistance, please provide more detailed error logs or specify the lines of code causing the errors for more targeted assistance.

Sources

About Dosu

This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.

Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.

If you want to continue the conversation, start your reply with @dosu-bot.

dosubot[bot] avatar Mar 02 '24 02:03 dosubot[bot]

打开翻墙VPN即可解决,亲测问题

Leng-bingo avatar Mar 02 '24 12:03 Leng-bingo

请问解决了吗 我也是同样的问题 vpn没用

ttPrivacy avatar Mar 17 '24 20:03 ttPrivacy