From 1bfea6966feb6553972229837bdee4e018d4da4a Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Sun, 16 Mar 2025 23:18:57 -0700 Subject: [PATCH] LoRA 16bit fix --- unsloth/models/loader.py | 5 ----- unsloth/models/vision.py | 10 +--------- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/unsloth/models/loader.py b/unsloth/models/loader.py index e3fab290a0..262d403b3a 100644 --- a/unsloth/models/loader.py +++ b/unsloth/models/loader.py @@ -479,11 +479,6 @@ class FastModel(FastBaseModel): "Also, we by default set `load_in_4bit = True`.\n"\ "If you want 8bit finetuning, set both `load_in_4bit = False` and `load_in_8bit = True`" ) - if load_in_4bit: pass - elif load_in_8bit: pass - elif not load_in_4bit and not load_in_8bit and not full_finetuning: - print("Unsloth: LoRA, QLoRA and full finetuning all not selected. Switching to QLoRA.") - load_in_4bit = True pass old_model_name = model_name diff --git a/unsloth/models/vision.py b/unsloth/models/vision.py index 8799e01522..bf11bc6c1e 100644 --- a/unsloth/models/vision.py +++ b/unsloth/models/vision.py @@ -263,15 +263,7 @@ class FastBaseModel: llm_int8_skip_modules = SKIP_QUANTIZATION_MODULES.copy(), ) elif not load_in_4bit and not load_in_8bit and not full_finetuning: - print("Unsloth: LoRA, QLoRA and full finetuning all not selected. Switching to QLoRA.") - load_in_4bit = True - bnb_config = BitsAndBytesConfig( - load_in_4bit = True, - bnb_4bit_use_double_quant = True, - bnb_4bit_quant_type = "nf4", - bnb_4bit_compute_dtype = bnb_compute_dtype, - llm_int8_skip_modules = SKIP_QUANTIZATION_MODULES.copy(), - ) + print("Unsloth: LoRA, QLoRA and full finetuning all not selected. Switching to 16bit LoRA.") pass if full_finetuning: