Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] 简洁阐述问题 /卡死在| INFO | root | UnstructuredFileLoader used for #1642

Closed
FakeSnake618 opened this issue Oct 2, 2023 · 11 comments
Labels
bug Something isn't working

Comments

@FakeSnake618
Copy link

问题描述 / Problem Description

已经可以用LLM正常对话聊天了

我用以下几种方式尝试均失败:
1、保留sample中的所有文件,直接命令行重建知识库,控制台没报错,就一直卡在 UnstructuredFileLoader,挂机挂了12个小时也没变化,CPU一直显示30%左右的占用
2、删掉sample文件夹,删除所有文档,命令行重建知识库后可以重建成功。
3、知识库页面刷新页面后,RUNNING状态消失,能看到添加的那3个txt文件,但都显示为没有向量库
4、点击txt、doc、pdf等文件添加至向量库,又是同样的情况,显示RUNNING,控制台卡在UnstructuredFileLoader

复现问题的步骤 / Steps to Reproduce

进入知识库管理页面
点击 添加至向量库
预期的结果 / Expected Result
上方显示RUNNING一段时间后,该txt文档的向量库状态显示打勾

实际结果 / Actual Result
页面上方一直显示RUNNING,控制台没有相关报错,只打印如下信息
INFO: ::1:58640 - "POST /llm_model/list_config_models HTTP/1.1" 200 OK
2023-10-02 16:17:29 | INFO | httpx | HTTP Request: POST http://localhost:7861/llm_model/list_config_models "HTTP/1.1 200 OK"
2023-10-02 16:17:49 | INFO | root | UnstructuredFileLoader used for D:\projects\kefu\Langchain-Chatchat-0.2.5\knowledge_base\002\content\002.docx
2023-10-02 16:22:49 | ERROR | root | ReadTimeout: error when post http://localhost:7861/knowledge_base/update_docs: timed out
2023-10-02 16:22:49 | INFO | root | UnstructuredFileLoader used for D:\projects\kefu\Langchain-Chatchat-0.2.5\knowledge_base\002\content\002.docx
2023-10-02 16:27:49 | ERROR | root | ReadTimeout: error when post http://localhost:7861/knowledge_base/update_docs: timed out
2023-10-02 16:27:49 | INFO | root | UnstructuredFileLoader used for D:\projects\kefu\Langchain-Chatchat-0.2.5\knowledge_base\002\content\002.docx
2023-10-02 16:32:49 | ERROR | root | ReadTimeout: error when post http://localhost:7861/knowledge_base/update_docs: timed out

环境信息 / Environment Information

langchain-ChatGLM 版本/commit 号:v0.2.5
是否使用 Docker 部署(是/否):no
使用的模型(ChatGLM-6B / ClueAI/ChatYuan-large-v2 等):ChatGLM2-6B
使用的 Embedding 模型(GanymedeNil/text2vec-large-chinese 等):text2vec-large-chinese
操作系统及版本 / Operating system and version: WIN10
Python 版本 / Python version: 3.10
其他相关环境信息 / Other relevant environment information: gtx 3060 8g 内存16g CPU I7-10875

查了一天半,只在之前关闭的一个issue中看到了同样的问题,有人在其中回答说pull一下最新的代码已经修复了。但是我使用的就是最新的0.2.5的代码,也问了gpt4查了overflow,实在没招了,上来问一下。对了,原始代码我唯一修改的地方就是将0.0.0.0修改为localhost,但是doc服务是正常运行的,只有UnstructuredFileLoader used这时会卡死。

其他信息:faiss未能Could not load library with AVX2 support due to:ModuleNotFoundError("No module named 'faiss.swigfaiss_avx2'"),但是faiss还是可以加载的。

@FakeSnake618 FakeSnake618 added the bug Something isn't working label Oct 2, 2023
@FakeSnake618
Copy link
Author

我还在尝试解决这个问题,将llm指定为cuda后,我将embedding指定为CPU,这次在上传文件时终于不再卡死,但是出现了新的报错:2023-10-02 22:00:10 | INFO | root | UnstructuredFileLoader used for D:\projects\kefu\Langchain-Chatchat-0.2.5\knowledge_base\002\content\002.docx
0 [main] python (420) D:\anconda\python.exe: *** fatal error - Internal error: TP_NUM_C_BUFS too small: 50
1743 [main] python (420) D:\anconda\python.exe: *** fatal error - Internal error: TP_NUM_C_BUFS too small: 50
2023-10-02 22:00:10 | ERROR | root | ReadError: error when post http://localhost:7861/knowledge_base/upload_docs: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
2023-10-02 22:00:14 | ERROR | root | ConnectError: error when post http://localhost:7861/knowledge_base/upload_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-10-02 22:00:18 | ERROR | root | ConnectError: error when post http://localhost:7861/knowledge_base/upload_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-10-02 22:00:18 | ERROR | root | AttributeError: API未能返回正确的JSON。无法连接API服务器,请确认已执行python server\api.py
2023-10-02 22:01:04 | ERROR | root | ConnectError: error when post http://localhost:7861/knowledge_base/update_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-10-02 22:01:08 | ERROR | root | ConnectError: error when post http://localhost:7861/knowledge_base/update_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-10-02 22:01:12 | ERROR | root | ConnectError: error when post http://localhost:7861/knowledge_base/update_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。
2023-10-02 22:01:12 | ERROR | root | AttributeError: API未能返回正确的JSON。无法连接API服务器,请确认已执行python server\api.py
2023-10-02 22:01:12.369 Please replace st.experimental_rerun with st.rerun.

st.experimental_rerun will be removed after 2024-04-01.

@FakeSnake618
Copy link
Author

加载遇到拒绝连接的情况后,我想要聚焦到底是网络问题还是加载非结构文件的问题,于是我重新执行python init_database.py --recreate-vs代码,果然在加载非结构文件这里继续卡死。database talbes reseted
recreating all vector stores
2023-10-02 23:03:37,014 - faiss_cache.py[line:75] - INFO: loading vector store in 'samples/vector_store' from disk.
2023-10-02 23:03:39,965 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: m3e-base
Batches: 100%|███████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.89it/s]
2023-10-02 23:03:41,944 - loader.py[line:54] - INFO: Loading faiss with AVX2 support.
2023-10-02 23:03:41,944 - loader.py[line:58] - INFO: Could not load library with AVX2 support due to:
ModuleNotFoundError("No module named 'faiss.swigfaiss_avx2'")
2023-10-02 23:03:41,944 - loader.py[line:64] - INFO: Loading faiss.
2023-10-02 23:03:41,959 - loader.py[line:66] - INFO: Successfully loaded faiss.
2023-10-02 23:03:42,007 - utils.py[line:289] - INFO: UnstructuredFileLoader used for D:\projects\001\Langchain-Chatchat-0.2.5\knowledge_base\samples\content\test.txt

@abbhay
Copy link

abbhay commented Oct 13, 2023

加载遇到拒绝连接的情况后,我想要聚焦到底是网络问题还是加载非结构文件的问题,于是我重新执行python init_database.py --recreate-vs代码,果然在加载非结构文件这里继续卡死。database talbes reseted recreating all vector stores 2023-10-02 23:03:37,014 - faiss_cache.py[line:75] - INFO: loading vector store in 'samples/vector_store' from disk. 2023-10-02 23:03:39,965 - SentenceTransformer.py[line:66] - INFO: Load pretrained SentenceTransformer: m3e-base Batches: 100%|███████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 15.89it/s] 2023-10-02 23:03:41,944 - loader.py[line:54] - INFO: Loading faiss with AVX2 support. 2023-10-02 23:03:41,944 - loader.py[line:58] - INFO: Could not load library with AVX2 support due to: ModuleNotFoundError("No module named 'faiss.swigfaiss_avx2'") 2023-10-02 23:03:41,944 - loader.py[line:64] - INFO: Loading faiss. 2023-10-02 23:03:41,959 - loader.py[line:66] - INFO: Successfully loaded faiss. 2023-10-02 23:03:42,007 - utils.py[line:289] - INFO: UnstructuredFileLoader used for D:\projects\001\Langchain-Chatchat-0.2.5\knowledge_base\samples\content\test.txt

老哥,你解决了么

@DiaboloBE
Copy link

Mac上MPS跑复现了这个问题,cuda跑就正常了

@Edisonwei54
Copy link

为什么关闭了,大佬们可以怎么解决

@FakeSnake618
Copy link
Author

问题尚未解决,我也不知道为什么问题会被关闭,另外,我是在cuda上跑的,并非mac

@kade0428
Copy link

我也遇到同樣的問題,跟樓主一模一樣,試了好幾天都找不出問題,要怎麼辦阿???

@kade0428
Copy link

自己回答自己的問題,找了好幾天的問題終於知道為什麼會有這些錯誤了,
主因是因為防毒軟體可能對 Git下載的 Langchang-ChatChat資料夾有防護,
導致你要導入的檔案沒有辦法正常寫入,所以你的檔案就不會被導入,
我是在Windows11的環境中安裝的,防毒軟體是用Windos Defender,
我將Langchang-ChatChat還有Conda的環境都放在防毒地排除範圍,
Pytorch不管是CPU版本還是CUDA版本都能正常運作。

@Zlenius
Copy link

Zlenius commented Nov 1, 2023

完全一致的问题,仍未解决

@Zlenius
Copy link

Zlenius commented Nov 3, 2023

完全一致的问题,仍未解决
已解决:我将python版本从3.9升级到3.10.12后重新安装依赖,随后不再出现这个问题

@pyy07
Copy link

pyy07 commented Dec 5, 2023

windows 10, Python 3.10.13, 同样的问题

End of stack trace (more stack frames may be present)
39759 [main] python (7768) D:\anaconda3\envs\Langchain-Chatchat\python.exe: *** fatal error - Internal error: TP_NUM_C_BUFS too small: 50
2023-12-05 19:21:24,376 - utils.py[line:95] - ERROR: ReadError: error when post /knowledge_base/update_docs: [WinError 10054] 远程主机强迫关闭了一个现有的连接。
2023-12-05 19:21:26,379 - utils.py[line:95] - ERROR: ConnectError: error when post /knowledge_base/update_docs: [WinError 10061] 由于目标计算机积极拒绝,无法连接。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants