Skip to content

Commit d091e43

Browse files
committed
Update vision.py
1 parent 936b79f commit d091e43

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

unsloth/models/vision.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -511,10 +511,11 @@ def from_pretrained(
511511
if full_finetuning:
512512
os.environ["UNSLOTH_ENABLE_FULL_FINETUNING"] = "1"
513513
if dtype == torch.bfloat16:
514-
print(
515-
f"Unsloth: Using bfloat16 full finetuning which cuts memory usage by 50%.\n"
516-
f"To enable float32 training, use `float32_mixed_precision = True` during FastLanguageModel.from_pretrained"
517-
)
514+
if float32_mixed_precision != True:
515+
print(
516+
f"Unsloth: Using bfloat16 full finetuning which cuts memory usage by 50%.\n"
517+
f"To enable float32 training, use `float32_mixed_precision = True` during FastLanguageModel.from_pretrained"
518+
)
518519
else:
519520
print("Unsloth: Float16 full finetuning uses more memory since we upcast weights to float32.")
520521
else:

0 commit comments

Comments
 (0)