From e657b21cc753b3a8bb90740071918e2d67f2aa1f Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Wed, 15 Oct 2025 14:30:50 -0700 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index 72a627b121..f4665565d4 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -1711,8 +1711,7 @@ def _prepare_model_for_qat(model: torch.nn.Module, qat_scheme: str) -> torch.nn. while hasttr(model, "model"): model._torchao_metadata = torchao_metadata model = model.model - if hasattr(model, "model"): - model._torchao_metadata = torchao_metadata + model._torchao_metadata = torchao_metadata quantize_(model, QATConfig(base_config, step="prepare"), filter_fn=filter_fn) return model pass