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 _utils.py

Daniel Han2019d0653f01
diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py
index eb5cc28a2b8..6728044c8e5 100644
--- a/unsloth/models/_utils.py
+++ b/unsloth/models/_utils.py
@@ -1683,7 +1683,7 @@ def _prepare_model_for_qat(model: torch.nn.Module, qat_scheme: Union[str, TorchA
from torchao.quantization.granularity import PerGroup
from torchao.quantization.qat import QATConfig
- if isinstance(qat_scheme, TorchAOConfig):
+ if not isinstance(qat_scheme, TorchAOConfig):
filter_fn = None
group_size = None
base_config = None