From 82e45c02a51594378880d2d807e1872e01ba5e76 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Sat, 24 Feb 2024 18:25:25 +1100 Subject: [PATCH] revert --- unsloth/models/gemma.py | 8 ++++---- unsloth/models/llama.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/unsloth/models/gemma.py b/unsloth/models/gemma.py index 3c2f799f57..1e7a0825f5 100644 --- a/unsloth/models/gemma.py +++ b/unsloth/models/gemma.py @@ -582,10 +582,10 @@ class FastGemmaModel(FastLlamaModel): # GemmaAttention .forward = GemmaAttention_fast_forward # GemmaSdpaAttention .forward = GemmaAttention_fast_forward # GemmaFlashAttention2.forward = GemmaAttention_fast_forward - GemmaDecoderLayer .forward = GemmaDecoderLayer_fast_forward - GemmaModel .forward = GemmaModel_fast_forward - GemmaForCausalLM .forward = GemmaForCausalLM_fast_forward - PeftModelForCausalLM.forward = PeftModelForCausalLM_fast_forward + # GemmaDecoderLayer .forward = GemmaDecoderLayer_fast_forward + # GemmaModel .forward = GemmaModel_fast_forward + # GemmaForCausalLM .forward = GemmaForCausalLM_fast_forward + # PeftModelForCausalLM.forward = PeftModelForCausalLM_fast_forward # Solves https://github.com/unslothai/unsloth/issues/168 # Static KV Cache was introduced in 4.38.0, causing training to be much slower. diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index ecc09b2145..fc839c9d45 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1400,7 +1400,7 @@ class FastLlamaModel: (down_proj.base_layer if hasattr(down_proj, "base_layer") else down_proj).bias is None: # https://stackoverflow.com/questions/50599045/python-replacing-a-function-within-a-class-of-a-module - layer.mlp.forward = types.MethodType(apply_lora_mlp, layer.mlp) + # layer.mlp.forward = types.MethodType(apply_lora_mlp, layer.mlp) n_mlp += 1 else: logger.warning_once(