From ba65a48ec8377bfd8799c926c641f850035ee595 Mon Sep 17 00:00:00 2001 From: camenduru <54370274+camenduru@users.noreply.github.com> Date: Sun, 7 May 2023 23:42:44 +0300 Subject: [PATCH] trust_remote_code=shared.args.trust_remote_code (#1891) --- modules/GPTQ_loader.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/GPTQ_loader.py b/modules/GPTQ_loader.py index e3f579ef..e9acbbd6 100644 --- a/modules/GPTQ_loader.py +++ b/modules/GPTQ_loader.py @@ -34,7 +34,7 @@ def _load_quant(model, checkpoint, wbits, groupsize=-1, faster_kernel=False, exc def noop(*args, **kwargs): pass - config = AutoConfig.from_pretrained(model) + config = AutoConfig.from_pretrained(model, trust_remote_code=shared.args.trust_remote_code) torch.nn.init.kaiming_uniform_ = noop torch.nn.init.uniform_ = noop torch.nn.init.normal_ = noop @@ -42,7 +42,7 @@ def _load_quant(model, checkpoint, wbits, groupsize=-1, faster_kernel=False, exc torch.set_default_dtype(torch.half) transformers.modeling_utils._init_weights = False torch.set_default_dtype(torch.half) - model = AutoModelForCausalLM.from_config(config) + model = AutoModelForCausalLM.from_config(config, trust_remote_code=shared.args.trust_remote_code) torch.set_default_dtype(torch.float) if eval: model = model.eval()