LoRA 16bit fix
This commit is contained in:
parent
9a96779887
commit
1bfea6966f
2 changed files with 1 additions and 14 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue