From f87372a499f255e1acd37c0ea96ea0a73ef80cef Mon Sep 17 00:00:00 2001 From: yiliu30 Date: Thu, 13 Nov 2025 01:50:23 -0500 Subject: [PATCH 1/2] fix Signed-off-by: yiliu30 --- auto_round/compressors/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/auto_round/compressors/base.py b/auto_round/compressors/base.py index 2634769a1..a001277c6 100644 --- a/auto_round/compressors/base.py +++ b/auto_round/compressors/base.py @@ -1551,14 +1551,16 @@ def quantize(self) -> tuple[torch.nn.Module, dict[str, Any]]: Returns: The quantized model and layer configurations. """ - for n, m in self.model.named_modules(): # TODO check if could removed - m.tmp_name = n + self._check_compatibility() formats = self.formats if hasattr(self, "formats") else None # It is best to modify the model structure in the quantize function and check the format, # because it may cause the gguf format to not be exported normally. self.model = _handle_moe_model(self.model, formats=formats) + for n, m in self.model.named_modules(): # TODO check if could removed + m.tmp_name = n + # TODO check scale_dtype if not self.is_auto_scheme: enable_gguf_official_mixed = True From f6950feb431a4e3a5b1a439f7ed105f9ae873e3b Mon Sep 17 00:00:00 2001 From: yiliu30 Date: Thu, 13 Nov 2025 02:21:20 -0500 Subject: [PATCH 2/2] add note Signed-off-by: yiliu30 --- auto_round/compressors/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auto_round/compressors/base.py b/auto_round/compressors/base.py index a001277c6..1b437ece3 100644 --- a/auto_round/compressors/base.py +++ b/auto_round/compressors/base.py @@ -1557,7 +1557,7 @@ def quantize(self) -> tuple[torch.nn.Module, dict[str, Any]]: # It is best to modify the model structure in the quantize function and check the format, # because it may cause the gguf format to not be exported normally. self.model = _handle_moe_model(self.model, formats=formats) - + # Assign temporary names after replacing modules for n, m in self.model.named_modules(): # TODO check if could removed m.tmp_name = n