From 182ab7e0cb28b21c0b3b119668ec3cd9aceb15de Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Fri, 19 Jul 2024 09:32:27 -0700 Subject: [PATCH] Update mistral.py --- unsloth/models/mistral.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unsloth/models/mistral.py b/unsloth/models/mistral.py index e0e034fc5c..ed6207bb06 100644 --- a/unsloth/models/mistral.py +++ b/unsloth/models/mistral.py @@ -299,8 +299,9 @@ class FastMistralModel(FastLlamaModel): attention_module = MistralAttention, ) # Just for Mistral Nemo models! - function = patch_mistral_nemo_attention(function) - if True:#init_name is not None: + if function is not None: + function = patch_mistral_nemo_attention(function) + # if True:#init_name is not None: exec(function, globals()) MistralAttention.__init__ = eval(init_name) pass