Skip to content

Commit

Permalink
Fix gradient_checkpointing_kwargs assignment in examples (#2331)
Browse files Browse the repository at this point in the history
Co-authored-by: Ping <[email protected]>
  • Loading branch information
Galaxy-Husky and Ping authored Nov 7, 2024
1 parent 7f2ccbe commit ac77c09
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/scripts/dpo_online.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
if __name__ == "__main__":
parser = TrlParser((ScriptArguments, OnlineDPOConfig, ModelConfig))
script_args, training_args, model_config = parser.parse_args_and_config()
script_args.gradient_checkpointing_kwargs = {"use_reentrant": True}
training_args.gradient_checkpointing_kwargs = {"use_reentrant": True}

torch_dtype = (
model_config.torch_dtype
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/nash_md.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
if __name__ == "__main__":
parser = TrlParser((ScriptArguments, NashMDConfig, ModelConfig))
script_args, training_args, model_config = parser.parse_args_and_config()
script_args.gradient_checkpointing_kwargs = {"use_reentrant": True}
training_args.gradient_checkpointing_kwargs = {"use_reentrant": True}

torch_dtype = (
model_config.torch_dtype
Expand Down
2 changes: 1 addition & 1 deletion examples/scripts/xpo.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
if __name__ == "__main__":
parser = TrlParser((ScriptArguments, XPOConfig, ModelConfig))
script_args, training_args, model_config = parser.parse_args_and_config()
script_args.gradient_checkpointing_kwargs = {"use_reentrant": True}
training_args.gradient_checkpointing_kwargs = {"use_reentrant": True}

torch_dtype = (
model_config.torch_dtype
Expand Down

0 comments on commit ac77c09

Please sign in to comment.