Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Update llama.py

Daniel Han-Chendff5c4271bd7
diff --git a/unsloth/models/llama.py b/unsloth/models/llama.py
index 1e301acc9b7..0e860b9de43 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