diff --git a/unsloth/kernels/fast_lora.py b/unsloth/kernels/fast_lora.py index df0bfbe624..b7afa134f2 100644 --- a/unsloth/kernels/fast_lora.py +++ b/unsloth/kernels/fast_lora.py @@ -90,8 +90,6 @@ class LoRA_MLP(torch.autograd.Function): e = matmul_lora(X, gateW, gateW_quant, gateA, gateB, gateS) g = matmul_lora(X, upW, upW_quant, upA, upB, upS) - # f = torch.nn.functional.silu(e) - # h = f * g h = _forward_function(e, g) i = matmul_lora(h, downW, downW_quant, downA, downB, downS) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 0c227321af..074cb0fad1 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -891,9 +891,10 @@ class FastLlamaModel: device_map = "sequential", rope_scaling = None, fix_tokenizer = True, - model_patcher = FastLlamaModel, + model_patcher = None, **kwargs, ): + if model_patcher is None: model_patcher = FastLlamaModel SUPPORTS_BFLOAT16 = torch.cuda.is_bf16_supported() gpu_stats = torch.cuda.get_device_properties(0) max_memory = round(gpu_stats.total_memory / 1024 / 1024 / 1024, 3) diff --git a/unsloth/models/mistral.py b/unsloth/models/mistral.py index 713205befb..6c9d9ecc5c 100644 --- a/unsloth/models/mistral.py +++ b/unsloth/models/mistral.py @@ -293,9 +293,10 @@ class FastMistralModel(FastLlamaModel): device_map = "sequential", rope_scaling = None, # Mistral does not support RoPE scaling fix_tokenizer = True, - model_patcher = FastMistralModel, + model_patcher = None, **kwargs, ): + if model_patcher is None: model_patcher = FastMistralModel # Mistral does NOT support RoPE Scaling! if rope_scaling is not None: logger.warning_once("Unsloth: Mistral models do not support RoPE scaling.")