在进行RLHF微调任务中,训练完奖励模型之后,再进行PPO训练,出现的报错信息显示不支持刚刚训练的奖励模型再进行PPO训练,求助各位如何解决?是我的训练奖励模型出差错还是PPO训练出差错?(所有训练的基座大模型都是Qwen2-7b-instruct,actor和critic模型共用同一个基座大模型Qwen2-7b-instruct)。图1为报错信息,图2为训练奖励模型,图3为PPO训练,图4为训练好的奖励模型其中的ckpts #183

Open
opened 2024-10-11 23:49:12 +08:00 by XPH · 5 comments

看报错是在这里

        if not self.supports_rm_adapter:
            raise ValueError("This model does not support reward modeling adapter.")

需要debug下,看看self.supports_rm_adapter为什么是false

看报错是在这里 ```python if not self.supports_rm_adapter: raise ValueError("This model does not support reward modeling adapter.") ``` 需要debug下,看看self.supports_rm_adapter为什么是false

看截屏是在平台上跑的,可以把代码【算法】共享下,我们debug看下什么原因

看截屏是在平台上跑的,可以把代码【算法】共享下,我们debug看下什么原因
Author

看截屏是在平台上跑的,可以把代码【算法】共享下,我们debug看下什么原因

好的感谢,已共享,算法名叫RLHF-GLM4,但是我把基座模型换成Qwen了

> 看截屏是在平台上跑的,可以把代码【算法】共享下,我们debug看下什么原因 好的感谢,已共享,算法名叫RLHF-GLM4,但是我把基座模型换成Qwen了

rlhf.py 里在使用AutoModelForCausalLMWithValueHead直接加载了qwen模型,这里是不对的。之前训练的reward没有用上
需要加上

model = AutoModelForCausalLMWithValueHead.from_pretrained(
    "./model/Qwen/Qwen2-7B-Instruct", 
    trust_remote_code=True, 
    device_map="auto", 
    peft_config=peft_config, 
    low_cpu_mem_usage=True, 
    torch_dtype=torch.bfloat16,
    reward_adapter="/code/medical_project/reward_model/checkpoint-350"
)
`rlhf.py` 里在使用`AutoModelForCausalLMWithValueHead`直接加载了qwen模型,这里是不对的。之前训练的reward没有用上 需要加上 ``` model = AutoModelForCausalLMWithValueHead.from_pretrained( "./model/Qwen/Qwen2-7B-Instruct", trust_remote_code=True, device_map="auto", peft_config=peft_config, low_cpu_mem_usage=True, torch_dtype=torch.bfloat16, reward_adapter="/code/medical_project/reward_model/checkpoint-350" ) ```
Author

rlhf.py 里在使用AutoModelForCausalLMWithValueHead直接加载了qwen模型,这里是不对的。之前训练的reward没有用上
需要加上

model = AutoModelForCausalLMWithValueHead.from_pretrained(
    "./model/Qwen/Qwen2-7B-Instruct", 
    trust_remote_code=True, 
    device_map="auto", 
    peft_config=peft_config, 
    low_cpu_mem_usage=True, 
    torch_dtype=torch.bfloat16,
    reward_adapter="/code/medical_project/reward_model/checkpoint-350"
)

原来如此,感谢老师,学习到了

> `rlhf.py` 里在使用`AutoModelForCausalLMWithValueHead`直接加载了qwen模型,这里是不对的。之前训练的reward没有用上 > 需要加上 > ``` > model = AutoModelForCausalLMWithValueHead.from_pretrained( > "./model/Qwen/Qwen2-7B-Instruct", > trust_remote_code=True, > device_map="auto", > peft_config=peft_config, > low_cpu_mem_usage=True, > torch_dtype=torch.bfloat16, > reward_adapter="/code/medical_project/reward_model/checkpoint-350" > ) > ``` > 原来如此,感谢老师,学习到了
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: HswOAuth/llm_course#183
No description provided.