Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████| 8/8 [11:29<00:00, 86.20s/it]
Traceback (most recent call last):
File “/app/JittorLLMs-main/cli_demo.py”, line 8, in
model = models.get_model(args)
File “/app/JittorLLMs-main/models/init.py”, line 45, in get_model
return module.get_model(args)
File “/app/JittorLLMs-main/models/chatglm/init.py”, line 48, in get_model
return ChatGLMMdoel(args)
File “/app/JittorLLMs-main/models/chatglm/init.py”, line 22, in init
self.model = AutoModel.from_pretrained(os.path.dirname(file), trust_remote_code=True)
File “/app/python3.9/lib/python3.9/site-packages/transformers/models/auto/auto_factory.py”, line 459, in from_pretrained
return model_class.from_pretrained(
File “/app/python3.9/lib/python3.9/site-packages/transformers/modeling_utils.py”, line 2478, in from_pretrained
) = cls._load_pretrained_model(
File “/app/python3.9/lib/python3.9/site-packages/transformers/modeling_utils.py”, line 2844, 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.
实在是没有办法了 盼复
根据这个提示增加上 ignore_mismatched_sizes=True 试试,从报错信息看,应该是大小不匹配导致的