trust_remote_code=shared.args.trust_remote_code (#1891)
This commit is contained in:
parent
b3bbda22d1
commit
ba65a48ec8
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue