Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
fix gradient issue for qlora on seq2seq. (#897)
Browse files Browse the repository at this point in the history
Signed-off-by: Ye, Xinyu <xinyu.ye@intel.com>
  • Loading branch information
XinyuYe-Intel authored Dec 9, 2023
1 parent 60942ea commit ff04655
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions intel_extension_for_transformers/llm/finetuning/finetuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,8 @@ def preprocess_logits_for_metrics(logits, labels):
model = prepare_model_for_kbit_training(
model, use_gradient_checkpointing=training_args.gradient_checkpointing
)
if training_args.gradient_checkpointing:
model.gradient_checkpointing_enable()

if not finetune_args.full_finetune:
# PEFT settings
Expand Down

0 comments on commit ff04655

Please sign in to comment.