mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-10-01 01:26:03 -04:00
trust_remote_code=shared.args.trust_remote_code (#1891)
This commit is contained in:
parent
b3bbda22d1
commit
ba65a48ec8
@ -34,7 +34,7 @@ def _load_quant(model, checkpoint, wbits, groupsize=-1, faster_kernel=False, exc
|
|||||||
def noop(*args, **kwargs):
|
def noop(*args, **kwargs):
|
||||||
pass
|
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.kaiming_uniform_ = noop
|
||||||
torch.nn.init.uniform_ = noop
|
torch.nn.init.uniform_ = noop
|
||||||
torch.nn.init.normal_ = 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)
|
torch.set_default_dtype(torch.half)
|
||||||
transformers.modeling_utils._init_weights = False
|
transformers.modeling_utils._init_weights = False
|
||||||
torch.set_default_dtype(torch.half)
|
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)
|
torch.set_default_dtype(torch.float)
|
||||||
if eval:
|
if eval:
|
||||||
model = model.eval()
|
model = model.eval()
|
||||||
|
Loading…
Reference in New Issue
Block a user