shibing624 / MedicalGPT

MedicalGPT: Training Your Own Medical GPT Model with ChatGPT Training Pipeline. 训练医疗大模型,实现了包括增量预训练(PT)、有监督微调(SFT)、RLHF、DPO、ORPO。
Apache License 2.0
3.24k stars 492 forks source link

Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for PeftModelForSequenceClassification #271

Closed waycup7 closed 10 months ago

waycup7 commented 10 months ago

Hello ,I get an error at reward_modeling(adapter_model) marge base model.

error message:

File "/home/airuser/.local/lib/python3.10/site-packages/torch/nn/modules/module.py", line 2152, in load_state_dict raise RuntimeError('Error(s) in loading state_dict for {}:\n\t{}'.format( RuntimeError: Error(s) in loading state_dict for PeftModelForSequenceClassification: size mismatch for base_model.model.score.modules_to_save.default.weight: copying a param with shape torch.Size([1, 5120]) from checkpoint, the shape in current model is torch.Size([2, 5120]).

thanks for help.

shibing624 commented 10 months ago

update code.