From a193011ba4a23610708e841adf910c84e341a25e Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Thu, 16 Oct 2025 02:42:26 -0700 Subject: [PATCH] Update _utils.py --- unsloth/models/_utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/unsloth/models/_utils.py b/unsloth/models/_utils.py index f4665565d4..4616bd3f91 100644 --- a/unsloth/models/_utils.py +++ b/unsloth/models/_utils.py @@ -1708,10 +1708,10 @@ def _prepare_model_for_qat(model: torch.nn.Module, qat_scheme: str) -> torch.nn. group_size = group_size, ) inner_model = model - while hasttr(model, "model"): - model._torchao_metadata = torchao_metadata - model = model.model - model._torchao_metadata = torchao_metadata + while hasattr(inner_model, "model"): + inner_model._torchao_metadata = torchao_metadata + inner_model = model.model + inner_model._torchao_metadata = torchao_metadata quantize_(model, QATConfig(base_config, step="prepare"), filter_fn=filter_fn) return model pass