Skip to content

Commit

Permalink
fix OOM problem
Browse files Browse the repository at this point in the history
  • Loading branch information
hiyouga committed Apr 8, 2023
1 parent 3d6f0e9 commit 384968b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions finetune_chatglm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ def main():

# Training
if training_args.do_train:
model.gradient_checkpointing_enable()
model.enable_input_require_grads()
trainer.train()
model.save_pretrained(training_args.output_dir)

Expand Down

0 comments on commit 384968b

Please sign in to comment.