fix: pin padding_free=False to keep max_length enforced (trl 1.6+)

Newer Unsloth versions auto-enable SFTConfig's padding_free when it's
left unset, which conflicts with an explicit max_length + packing=False
and raises a ValueError at SFTTrainer init. Verified end-to-end on a
GTX 1650 (4GB VRAM): 60 steps complete cleanly, peak reserved memory
1.543 GB (42% of total), train_loss 1.662 -> 1.264.
This commit is contained in:
Kunwar Satyam Singh 2026-07-29 14:22:44 +05:30
commit a28991ee08

View file

@ -94,6 +94,8 @@ def main():
max_length = max_seq_length,
dataset_num_proc = 2,
packing = False, # True can spike VRAM on variable-length samples
padding_free = False, # Unsloth auto-enables this when unset, which conflicts
# with an explicit max_length + packing=False (trl 1.6+)
)
# ── 5. Initialize trainer ─────────────────────────────────────────────────