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

程序运行后一直卡住

Open ngbruce opened this issue 1 year ago • 8 comments

感谢作者的付出,不过本人在运行时出现了问题,请大家帮助。 情况如下:

win10, anaconda环境,Python 3.10, 已根据 requirements.txt 安装了组件。 另外,在hugging face下载了 GanymedeNil\text2vec-large-chinese,放在这个项目根目录下。 chatglm_llm.py 也按照 ChatGLM-6B放置的路径进行了修改。

运行knowledge_based_chatglm.py 后,显存占用也正常 (这个文件使用了myml/langchain-ChatGLM 的分支,修正了之前显存占用翻倍的问题),然而虽然没有发生异常,但在输入参考文件路径之后,程序一直卡着不动,CPU有一个核心满负荷,但没有进一步输出。

控制台信息粘贴在下面,请大家指点一下是怎么回事:(有警告的那个GPU没有影响,是GTX650,实际模型运行在 P40上)

Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision. Explicitly passing a revision is encouraged when loading a configuration with custom code to ensure no malicious code has been contributed in a newer revision. Explicitly passing a revision is encouraged when loading a model with custom code to ensure no malicious code has been contributed in a newer revision. Loading checkpoint shards: 100%|██████████| 8/8 [00:22<00:00, 2.81s/it] C:\Users\Admin\anaconda3\envs\langchain-glm\lib\site-packages\torch\cuda_init_.py:132: UserWarning: Found GPU1 NVIDIA GeForce GTX 650 which is of cuda capability 3.0. PyTorch no longer supports this GPU because it is too old. The minimum cuda capability supported by this library is 3.7.

warnings.warn(old_gpu_warn % (d, name, major, minor, min_arch // 10, min_arch % 10)) Input your local knowledge file path 请输入本地知识文件路径:D:\My_Doc\PyTorchProj\ChatGLM\ChatGLM-6B\README.md No sentence-transformers model found with name GanymedeNil/text2vec-large-chinese. Creating a new one with MEAN pooling.

ngbruce avatar Apr 05 '23 08:04 ngbruce

我也遇到了一样的问题,他们这里用的senttence embedding有问题

oashua avatar Apr 05 '23 09:04 oashua

@ngbruce @oashua 这里是使用 text2vec-large-chinese 作 embedding,虽然该模型不能直接作为 sentence-transformer,但是langchain会默认使用平均值作为每句文本的向量,这句只是警告/提示信息,不影响程序的正常运行。

如果测试过程中使用了 ChatGLM-6B 最新版的 README.md 可能因为其中包含了特殊字符,导致文档加载过程中出错,可以尝试使用其他不含特殊字符的文本文件进行测试

imClumsyPanda avatar Apr 05 '23 13:04 imClumsyPanda

你好,我尝试了复制一个新的readme2.txt,把里面的内容改为很简单,没有特殊符号,情况还是一样。 而且我尝试在提示输入本地知识文件路径是,故意输入一个不存在的路径,但表现一样,所以程序是卡在实际去读取知识文件之前.

然后单步试了一轮,发现是卡在 unstructured.py 文件的 93行 from unstructured.partition.auto import partition

尝试更新了 unstructured 到版本 0.5.11,问题依旧,卡在 unstructured.py 文件的
32行 : import unstructured

ngbruce avatar Apr 05 '23 20:04 ngbruce

您好 ,解决了吗 我也遇到同样的问题

yankuo111 avatar Apr 06 '23 01:04 yankuo111

安装的时候提示这个错误 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorflow 2.12.0 requires protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<5.0.0dev,>=3.20.3, but you have protobuf 3.18.3 which is incompatible. tensorflow-hub 0.13.0 requires protobuf>=3.19.6, but you have protobuf 3.18.3 which is incompatible. tensorboard 2.12.1 requires protobuf>=3.19.6, but you have protobuf 3.18.3 which is incompatible.

jianbin91 avatar Apr 06 '23 03:04 jianbin91

Found GPU1 NVIDIA GeForce GTX 650 which is of cuda capability 3.0. PyTorch no longer supports this GPU because it is too old. 你的这个显卡不能用,因为太老了,这个模型跑起来基本占用了14GB左右。

Dhaizei avatar Apr 06 '23 09:04 Dhaizei

Found GPU1 NVIDIA GeForce GTX 650 which is of cuda capability 3.0. PyTorch no longer supports this GPU because it is too old. 你的这个显卡不能用,因为太老了,这个模型跑起来基本占用了14GB左右。

一楼已经说明了:(有警告的那个GPU没有影响,是GTX650,实际模型运行在 P40上)

ngbruce avatar Apr 06 '23 17:04 ngbruce

您好 ,解决了吗 我也遇到同样的问题

还没有,尝试把Python从3.10换成 3.8也不行

ngbruce avatar Apr 06 '23 17:04 ngbruce

你好,解决了吗?遇到的相同的问题。 @ngbruce

mosqlee avatar Apr 23 '23 01:04 mosqlee

我找到问题了,windows下使用gitbash 就会卡住或者报segmentation fault,使用powershell或者CMD就不会,希望对其他人有帮助。 @ngbruce @oashua 可能的原因:https://stackoverflow.com/questions/52615628/git-bash-segmentation-fault-problem-windows

mosqlee avatar Apr 23 '23 02:04 mosqlee

你好,我尝试了复制一个新的readme2.txt,把里面的内容改为很简单,没有特殊符号,情况还是一样。 而且我尝试在提示输入本地知识文件路径是,故意输入一个不存在的路径,但表现一样,所以程序是卡在实际去读取知识文件之前.

然后单步试了一轮,发现是卡在 unstructured.py 文件的 93行 from unstructured.partition.auto import partition

尝试更新了 unstructured 到版本 0.5.11,问题依旧,卡在 unstructured.py 文件的 32行 : import unstructured

我也遇到了同样的问题,确实是from unstructured.partition.auto import partition出现问题。后来发现是windows下的imagic 不能像linux下一样使用,需要添加额外的dll,参考https://pypi.org/project/python-magic/。完善后应该就没问题了

Mocifiel avatar Apr 24 '23 16:04 Mocifiel

@Mocifiel 能详细说说怎么解决的吗,已经弄了一天还是还是卡在这

zhang375765 avatar Apr 25 '23 07:04 zhang375765

如果你是windows系统下运行的,按照我说的链接安装一个额外的python-magic动态库应该就行了。

Mocifiel avatar Apr 27 '23 01:04 Mocifiel

你好,我尝试了复制一个新的readme2.txt,把里面的内容改为很简单,没有特殊符号,情况还是一样。 而且我尝试在提示输入本地知识文件路径是,故意输入一个不存在的路径,但表现一样,所以程序是卡在实际去读取知识文件之前. 然后单步试了一轮,发现是卡在 unstructured.py 文件的 93行 from unstructured.partition.auto import partition 尝试更新了 unstructured 到版本 0.5.11,问题依旧,卡在 unstructured.py 文件的 32行 : import unstructured

我也遇到了同样的问题,确实是from unstructured.partition.auto import partition出现问题。后来发现是windows下的imagic 不能像linux下一样使用,需要添加额外的dll,参考https://pypi.org/project/python-magic/。完善后应该就没问题了

感谢!@Mocifiel win10 下面使用 方式解决 pip install python-magic-bin

cqfxchina avatar May 10 '23 08:05 cqfxchina

楼主,你后面问题解决了吗?想了解下你用P40的卡跑默认模型,响应延迟和输出速度如何?

margox avatar May 17 '23 07:05 margox

我的是向量模型文件没改为本地路径,所以每次执行网络下载因为网络不好报错。需要修改model_config里向量那个文件embedding_model_dict里text2vec值到本地位置 "text2vec": "/opt/*****/text2vec-large-chinese", 同样LLM的文件也要改到本地路径

flowbywind avatar Aug 11 '23 17:08 flowbywind