Skip to content

Commit

Permalink
Update llama.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhanchen committed Jun 16, 2024
1 parent 2714a8b commit 771a0d0
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions unsloth/models/llama.py
Original file line number Diff line number Diff line change
@@ -1871,16 +1871,16 @@ def patch_peft_model(
internal_model.max_seq_length = max_seq_length

# Patch tokenizer to pad to the right
# internal_model = model
# while hasattr(internal_model, "model"):
# if hasattr(internal_model, "_saved_temp_tokenizer"):
# internal_model._saved_temp_tokenizer.padding_side = "right"
# pass
# internal_model = internal_model.model
# pass
# if hasattr(internal_model, "_saved_temp_tokenizer"):
# internal_model._saved_temp_tokenizer.padding_side = "right"
# pass
internal_model = model
while hasattr(internal_model, "model"):
if hasattr(internal_model, "_saved_temp_tokenizer"):
internal_model._saved_temp_tokenizer.padding_side = "right"
pass
internal_model = internal_model.model
pass
if hasattr(internal_model, "_saved_temp_tokenizer"):
internal_model._saved_temp_tokenizer.padding_side = "right"
pass

# Clear deleted GPU items
for _ in range(3):

0 comments on commit 771a0d0

Please sign in to comment.