Skip to content

Commit

Permalink
Update _utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhanchen committed Apr 9, 2024
1 parent d95daa0 commit 35dbef8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion unsloth/models/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def prepare_model_for_kbit_training(

# Freeze all parameters except LoRA
import re
with torch.inference_mode():
with torch.no_grad():
for name, param in model.named_parameters():
if ".lora_A." in name or ".lora_B." in name or ".lora_magnitude_vector" in name:
param.requires_grad_(True)
Expand Down

0 comments on commit 35dbef8

Please sign in to comment.