From 764da0bd1e56fc161d5f14b7d7c0385eb746638f Mon Sep 17 00:00:00 2001 From: LRL2-ModelCloud Date: Fri, 17 Oct 2025 11:56:20 +0800 Subject: [PATCH] XIELUActivation will use some weights when activation init, so can't use init_empty_weights --- gptqmodel/models/loader.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gptqmodel/models/loader.py b/gptqmodel/models/loader.py index 95d768cff..e562870b3 100644 --- a/gptqmodel/models/loader.py +++ b/gptqmodel/models/loader.py @@ -202,6 +202,10 @@ def skip(*args, **kwargs): cls.before_model_load(cls, load_quantized_model=False) from ..utils.hf import build_shell_model + # XIELUActivation will use some weights when activation init, so can't use init_empty_weights + if hasattr(config, "hidden_act") and config.hidden_act == "xielu": + quantize_config.offload_to_disk = False + if quantize_config.offload_to_disk: model = build_shell_model(cls.loader, config=config, **model_init_kwargs) model._model_init_kwargs = model_init_kwargs