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

不支持新版的chatglm #14

Open
YIZXIY opened this issue Apr 3, 2023 · 3 comments
Open

不支持新版的chatglm #14

YIZXIY opened this issue Apr 3, 2023 · 3 comments

Comments

@YIZXIY
Copy link

YIZXIY commented Apr 3, 2023

更新一下前段时间的chatglm模型文件之后运行报错如下
Traceback (most recent call last):
File "D:\Desktop\CreativeChatGLM-master\app.py", line 18, in
predictor = ChatGLM(model_name)
File "D:\Desktop\CreativeChatGLM-master\predictors\chatglm2.py", line 40, in init
model = ChatGLMForConditionalGeneration.from_pretrained(
File "D:\Python\Python310\lib\site-packages\transformers\modeling_utils.py", line 2646, in from_pretrained
) = cls._load_pretrained_model(
File "D:\Python\Python310\lib\site-packages\transformers\modeling_utils.py", line 3019, in _load_pretrained_model
raise RuntimeError(f"Error(s) in loading state_dict for {model.class.name}:\n\t{error_msg}")
RuntimeError: Error(s) in loading state_dict for ChatGLMForConditionalGeneration:
size mismatch for transformer.word_embeddings.weight: copying a param with shape torch.Size([130528, 4096]) from checkpoint, the shape in current model is torch.Size([150528, 4096]).
size mismatch for lm_head.weight: copying a param with shape torch.Size([130528, 4096]) from checkpoint, the shape in current model is torch.Size([150528, 4096]).
You may consider adding ignore_mismatched_sizes=True in the model from_pretrained method.
cuda11.8
python3.10
pytorch2.0.0
windows10

@YIZXIY
Copy link
Author

YIZXIY commented Apr 3, 2023

我是说int4-slim版

@ypwhs
Copy link
Owner

ypwhs commented Apr 4, 2023

你说的是这个模型吧:https://github.com/silverriver/ChatGLM-6B-Slim

我尝试一下。

@ypwhs
Copy link
Owner

ypwhs commented Apr 4, 2023

修复了,你试试最新版:

@ypwhs ypwhs mentioned this issue Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants