CreativeChatGLM icon indicating copy to clipboard operation
CreativeChatGLM copied to clipboard

不支持新版的chatglm

Open YIZXIY opened this issue 1 year ago • 3 comments

更新一下前段时间的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 avatar Apr 03 '23 14:04 YIZXIY

我是说int4-slim版

YIZXIY avatar Apr 03 '23 15:04 YIZXIY

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

我尝试一下。

ypwhs avatar Apr 04 '23 01:04 ypwhs

修复了,你试试最新版:

ypwhs avatar Apr 04 '23 02:04 ypwhs