From b174e54507166987f44a59cb5d1e11a4ce8bf770 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Sat, 24 Feb 2024 19:33:04 +1100 Subject: [PATCH] Update gemma.py --- unsloth/models/gemma.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/unsloth/models/gemma.py b/unsloth/models/gemma.py index 2383ea2bb4..bbc7f811fe 100644 --- a/unsloth/models/gemma.py +++ b/unsloth/models/gemma.py @@ -618,22 +618,22 @@ class FastGemmaModel(FastLlamaModel): # Also patch all dtypes - BnB seems to not allocate the correct type? # BnB default dtype seems to be float16! - correct_dtype = lm_head.weight.dtype + # correct_dtype = lm_head.weight.dtype - for name, module in model.named_modules(): - if isinstance(module, (Bnb_Linear4bit, Peft_Linear4bit)): - weight = module.weight - quant_state = weight.quant_state + # for name, module in model.named_modules(): + # if isinstance(module, (Bnb_Linear4bit, Peft_Linear4bit)): + # weight = module.weight + # quant_state = weight.quant_state - if type(quant_state) is list: - # BnB seems to have float16 as default! - module.weight.quant_state[2] = correct_dtype # Cast to correct dtype - else: - # https://github.com/TimDettmers/bitsandbytes/pull/763/files - quant_state.dtype = correct_dtype - pass - pass - pass + # if type(quant_state) is list: + # # BnB seems to have float16 as default! + # module.weight.quant_state[2] = correct_dtype # Cast to correct dtype + # else: + # # https://github.com/TimDettmers/bitsandbytes/pull/763/files + # quant_state.dtype = correct_dtype + # pass + # pass + # pass # Add 1 to weight # return output * (1 + self.weight)