THUDM / ChatGLM-6B

ChatGLM-6B: An Open Bilingual Dialogue Language Model | 开源双语对话语言模型
Apache License 2.0
40.49k stars 5.2k forks source link

V1.1, 加载时报错 Unable to load weights from pytorch checkpoint file for './model/chatglm-6b/pytorch_model-00001-of-00008.bin' at './model/chatglm-6b/pytorch_model-00001-of-00008.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True. #1104

Open hanswang73 opened 1 year ago

hanswang73 commented 1 year ago

Is there an existing issue for this?

Current Behavior

v1.1,加载时报错 Unable to load weights from pytorch checkpoint file for './model/chatglm-6b/pytorch_model-00001-of-00008.bin' at './model/chatglm-6b/pytorch_model-00001-of-00008.bin'. If you tried to load a PyTorch model from a TF 2.0 checkpoint, please set from_tf=True.

之前 v1.0 都是好的

Expected Behavior

正常加载

Steps To Reproduce

PyTorch 2.0.0, Python 3.8, ubuntu 20.04, Cuda 11.8 GPU: RTX A5000(24GB) * 1

Environment

- OS:
- Python:
- Transformers:
- PyTorch:
- CUDA Support (`python -c "import torch; print(torch.cuda.is_available())"`) :

Anything else?

no

nBp1Ng commented 7 months ago

这个问题最后解决了吗

Owen-Liuyuxuan commented 7 months ago

I am not sure if my situation is the same. My loading error comes from the

unpickler = UnpicklerWrapper(data_file, **pickle_load_args)

TypeError: 'weights_only' is an invalid keyword argument for Unpickler()

I manage to get passed by downgrading transformer to version smaller than 4.37.0 (4.36.*)