mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2024-11-23 00:18:20 +01:00
More trust_remote_code=trust_remote_code (#1899)
This commit is contained in:
parent
56a5969658
commit
d3ea70f453
@ -204,9 +204,9 @@ def load_model(model_name):
|
|||||||
|
|
||||||
checkpoint = Path(f'{shared.args.model_dir}/{model_name}')
|
checkpoint = Path(f'{shared.args.model_dir}/{model_name}')
|
||||||
if shared.args.load_in_8bit and params.get('max_memory', None) is not None and params['device_map'] == 'auto':
|
if shared.args.load_in_8bit and params.get('max_memory', None) is not None and params['device_map'] == 'auto':
|
||||||
config = AutoConfig.from_pretrained(checkpoint)
|
config = AutoConfig.from_pretrained(checkpoint, trust_remote_code=trust_remote_code)
|
||||||
with init_empty_weights():
|
with init_empty_weights():
|
||||||
model = LoaderClass.from_config(config)
|
model = LoaderClass.from_config(config, trust_remote_code=trust_remote_code)
|
||||||
|
|
||||||
model.tie_weights()
|
model.tie_weights()
|
||||||
params['device_map'] = infer_auto_device_map(
|
params['device_map'] = infer_auto_device_map(
|
||||||
|
Loading…
Reference in New Issue
Block a user