From 4773950b6574ffd0e440afeaa2ed913f49d3ab56 Mon Sep 17 00:00:00 2001 From: Daniel Han-Chen Date: Fri, 7 Jun 2024 04:54:57 +1000 Subject: [PATCH] Update llama.py --- unsloth/models/llama.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py index 1e301acc9b..0e860b9de4 100644 --- a/unsloth/models/llama.py +++ b/unsloth/models/llama.py @@ -1830,6 +1830,11 @@ class FastLlamaModel: @staticmethod def for_inference(model): + if model.config.model_type == "qwen2": + FastLlamaModel.for_training(model) + return + pass + internal_model = model internal_model.gradient_checkpointing = False internal_model.training = False