ChatGLM-6B
ChatGLM-6B copied to clipboard
模型预测无报错,但是返回的内容为空
Is there an existing issue for this?
- [X] I have searched the existing issues
Current Behavior
模型预测无报错,但是返回的内容为空
Expected Behavior
No response
Steps To Reproduce
运行以下命令,打印的response是空字符串。
from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True) model = AutoModel.from_pretrained("THUDM/chatglm-6b", trust_remote_code=True).half().cuda() response, history = model.chat(tokenizer, "你好", history=[]) print('response',response)
Environment
环境:
protobuf 3.19.5
transformers 4.26.1
icetk 尝试了0.0.4/0.0.5两个版本,这些版本需要 protobuf 3.18,需要强制安装protobuf 3.19
cpm-kernels 1.0.11
torch 1.13.1
Python 3.10.9
Anything else?
No response
经过测试,下载的模型文件有问题,导致无输出
我也遇到这个问题了额. 请问你是如何解决的呢? 我重新下载了模型, 还是不行.
在cli下同样问题,直接运行cli_demo.py输入并无输出。
在cli下同样问题,直接运行cli_demo.py输入并无输出。
这一项目在几小时前添加了stream output,你可能需要更新一下【本代码仓库】的代码,并且确保模型文件和huggingface上的最新版一致,再重新运行模型。
我也遇到这个问题了额. 请问你是如何解决的呢? 我重新下载了模型, 还是不行. 在 hugging face 中重新下载了一遍模型, 问题就解决了.
-
安装 huggingface_hub
$ pip install huggingface_hub
-
在 ChatGLM-6B 项目目录下, 进入 Python 终端, 执行:
>>> from huggingface_hub import snapshot_download
>>> snapshot_download(repo_id="THUDM/ChatGLM-6B", local_dir="models")
Refer to:
- https://huggingface.co/docs/huggingface_hub/v0.13.2/guides/download#download-an-entire-repository
遇到同样的问题,更新到最新的代码和最新的模型,还是一样。请问之前这个问题解决了吗?
这个方法也不行,报错
OSError: [Errno 38] Function not implemented: '/root/.cache/huggingface/hub/models--THUDM--ChatGLM-6B/blobs/fe5bac6bfa5b5404ddfe3fabe04862b785e013afd7b308b7beca08239f9489fa' -> '/mnt/models/pytorch_model-00001-of-00008.bin'
看来是不能用清华云盘上的那个权重了,那个估计是有些老了。
我也是碰到的同样问题。用的是清华云盘上的权重和cli_demo。