Skip to content

Commit

Permalink
🧩 Add optimizer_cls_and_kwargs attribute to PPOTrainer and `RLOOT…
Browse files Browse the repository at this point in the history
…rainer` (#2302)
  • Loading branch information
qgallouedec authored Oct 31, 2024
1 parent 73c3970 commit d57a181
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions trl/trainer/ppo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def __init__(
self.data_collator = data_collator
self.eval_dataset = eval_dataset
self.optimizer, self.lr_scheduler = optimizers
self.optimizer_cls_and_kwargs = None # needed for transformers >= 4.47

#########
# calculate various batch sizes
Expand Down
1 change: 1 addition & 0 deletions trl/trainer/rloo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def __init__(
self.data_collator = data_collator
self.eval_dataset = eval_dataset
self.optimizer, self.lr_scheduler = optimizers
self.optimizer_cls_and_kwargs = None # needed for transformers >= 4.47

#########
# calculate various batch sizes
Expand Down

0 comments on commit d57a181

Please sign in to comment.