From d3ea70f453e91c39f0f5ba5487432e6ba181102c Mon Sep 17 00:00:00 2001 From: EgrorBs <44816767+EgrorBs@users.noreply.github.com> Date: Mon, 8 May 2023 05:48:20 +0300 Subject: [PATCH] More trust_remote_code=trust_remote_code (#1899) --- modules/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/models.py b/modules/models.py index 01201eee..24fafb37 100644 --- a/modules/models.py +++ b/modules/models.py @@ -204,9 +204,9 @@ def load_model(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': - config = AutoConfig.from_pretrained(checkpoint) + config = AutoConfig.from_pretrained(checkpoint, trust_remote_code=trust_remote_code) with init_empty_weights(): - model = LoaderClass.from_config(config) + model = LoaderClass.from_config(config, trust_remote_code=trust_remote_code) model.tie_weights() params['device_map'] = infer_auto_device_map(