ColossalAI icon indicating copy to clipboard operation
ColossalAI copied to clipboard

[BUG]:chatgpt inference still ERROR after fix

Open wac81 opened this issue 2 years ago • 4 comments

🐛 Describe the bug

still error:

size mismatch for transformer.ln_f.weight: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for transformer.ln_f.bias: copying a param with shape torch.Size([768]) from checkpoint, the shape in current model is torch.Size([64]). size mismatch for lm_head.weight: copying a param with shape torch.Size([50257, 768]) from checkpoint, the shape in current model is torch.Size([250880, 64]).

params: parser.add_argument('--model', default='bloom', choices=['gpt2', 'bloom', 'opt']) parser.add_argument('--pretrain', type=str, default='./actor_checkpoint_prompts.pt')

Environment

No response

wac81 avatar Mar 02 '23 16:03 wac81

File "inference.py", line 56, in eval(args) File "inference.py", line 21, in eval actor.model.load_state_dict(state_dict) File "/home/rst/ColossalAI/env/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1671, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format(

wac81 avatar Mar 02 '23 16:03 wac81

Thanks for your feedback, can you show your command line code please?

ht-zhou avatar Mar 03 '23 01:03 ht-zhou

python inference.py --pretrain ./actor_checkpoint_prompts.pt --model bloom

wac81 avatar Mar 03 '23 06:03 wac81

if i use gpt2 to train , i get right results, bloom is not right any way.

wac81 avatar Mar 03 '23 06:03 wac81