加载CPT模型报错
Foehnc opened this issue · 2 comments
Foehnc commented
RuntimeError: Error(s) in loading state_dict for CPTForConditionalGeneration: size mismatch for model.encoder.embeddings.position_ids: copying a param with shape torch.Size([1, 1024]) from checkpoint, the shape in current model is torch.Size([1, 512]). size mismatch for model.encoder.embeddings.position_embeddings.weight: copying a param with shape torch.Size([1024, 1024]) from checkpoint, the shape in current model is torch.Size([512, 1024]). You may consider adding
ignore_mismatched_sizes=Truein the model
from_pretrained method.
加载cpt-base和cpt-large的时候都报这个错,这是不是config文件的维度写错了导致初始化的模型维度和权重维度不匹配
StevenTang1998 commented
你可以更新一下最新的仓库并重新安装,我们最近已经解决了这个问题
Foehnc commented
好的我试下