Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Patch PEFT
Daniel Hanfcf92c54caed
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.pyindex ba4362b3cdb..96eb5035e83 100644--- a/unsloth/models/llama.py+++ b/unsloth/models/llama.py@@ -2063,9 +2063,9 @@ class FastLlamaModel:(getattr(gate_proj, "base_layer", gate_proj).bias is None) and \(getattr( up_proj, "base_layer", up_proj).bias is None) and \(getattr(down_proj, "base_layer", down_proj).bias is None) and \- (getattr(gate_proj, "lora_magnitude_vector", None) is None) and \- (getattr( up_proj, "lora_magnitude_vector", None) is None) and \- (getattr(down_proj, "lora_magnitude_vector", None) is None):+ (len(getattr(gate_proj, "lora_magnitude_vector", [])) == 0) and \+ (len(getattr( up_proj, "lora_magnitude_vector", [])) == 0) and \+ (len(getattr(down_proj, "lora_magnitude_vector", [])) == 0):# https://stackoverflow.com/questions/50599045/python-replacing-a-function-within-a-class-of-a-modulelayer.mlp.forward = types.MethodType(apply_lora_mlp, layer.mlp)@@ -2085,11 +2085,11 @@ class FastLlamaModel:hasattr(k_proj, "lora_A") and \hasattr(v_proj, "lora_A") and \(getattr(q_proj, "base_layer", q_proj).bias is None) and \- (getattr(q_proj, "base_layer", k_proj).bias is None) and \- (getattr(q_proj, "base_layer", v_proj).bias is None) and \- (getattr(q_proj, "lora_magnitude_vector", None) is None) and \- (getattr(k_proj, "lora_magnitude_vector", None) is None) and \- (getattr(v_proj, "lora_magnitude_vector", None) is None):+ (getattr(k_proj, "base_layer", k_proj).bias is None) and \+ (getattr(v_proj, "base_layer", v_proj).bias is None) and \+ (len(getattr(q_proj, "lora_magnitude_vector", [])) == 0) and \+ (len(getattr(k_proj, "lora_magnitude_vector", [])) == 0) and \+ (len(getattr(v_proj, "lora_magnitude_vector", [])) == 0):layer.self_attn.apply_qkv = apply_lora_qkvn_qkv += 1@@ -2106,7 +2106,7 @@ class FastLlamaModel:o_proj = layer.self_attn.o_projif hasattr(o_proj, "lora_A") and \(getattr(o_proj, "base_layer", o_proj).bias is None) and \- (getattr(o_proj, "lora_magnitude_vector", None) is None):+ (len(getattr(o_proj, "lora_magnitude_vector", [])) == 0):layer.self_attn.apply_o = apply_lora_on_o += 1