1. Learn
  2. /
  3. Courses
  4. /
  5. Reinforcement Learning from Human Feedback (RLHF)

Connected

Exercise

Setting up the reward trainer

Your project continues and you now have the model and config objects ready to start training the reward model.

The training and evaluation datasets have been preloaded as train_data and eval_data. The RewardTrainer has been imported from trl.

Instructions

100 XP
  • Initialize the RewardTrainer() by assigning the model, tokenizer, training dataset, evaluation dataset, and reward configuration to its attributes.