shibing624 / MedicalGPT

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

chatglm3训练在rm之后,进行lora模型权重合并到base model,出现问题:ValueError: chatglm does not support sequence classification #344

Closed cove1011 closed 3 months ago

cove1011 commented 3 months ago

Traceback (most recent call last): File "F:\xiazai\MedicalGPT-main\merge_peft_adapter.py", line 109, in main() File "F:\xiazai\MedicalGPT-main\merge_peft_adapter.py", line 64, in main raise ValueError("chatglm does not support sequence classification") ValueError: chatglm does not support sequence classification

cove1011 commented 3 months ago

出现了新问题: Traceback (most recent call last): File "F:\xiazai\MedicalGPT-main\merge_peft_adapter.py", line 110, in main() File "F:\xiazai\MedicalGPT-main\merge_peft_adapter.py", line 93, in main new_model = PeftModel.from_pretrained( File "C:\Users\admin.conda\envs\newrlhf\lib\site-packages\peft\peft_model.py", line 342, in from_pretrained remove_hook_from_submodules(model) File "C:\Users\admin.conda\envs\newrlhf\lib\site-packages\accelerate\hooks.py", line 526, in remove_hook_from_submodules remove_hook_from_submodules(child) File "C:\Users\admin.conda\envs\newrlhf\lib\site-packages\accelerate\hooks.py", line 524, in remove_hook_from_submodules remove_hook_from_module(module) File "C:\Users\admin.conda\envs\newrlhf\lib\site-packages\accelerate\hooks.py", line 193, in remove_hook_from_module module._hf_hook.detach_hook(module) File "C:\Users\admin.conda\envs\newrlhf\lib\site-packages\accelerate\hooks.py", line 388, in detach_hook set_module_tensor_to_device(module, name, device, value=self.weights_map.get(name, None)) File "C:\Users\admin.conda\envs\newrlhf\lib\site-packages\accelerate\utils\modeling.py", line 341, in set_module_tensor_to_device raise ValueError(f"{tensor_name} is on the meta device, we need a value to put in on {device}.") ValueError: weight is on the meta device, we need a value to put in on cpu. 最后一行,weight is on the meta device, we need a value to put in on cpu.

shibing624 commented 3 months ago

chatglm3不支持rm。