From c0bdcee646a011a6380e39650dab155d50b1cfba Mon Sep 17 00:00:00 2001 From: sam-ngu <30950704+sam-ngu@users.noreply.github.com> Date: Fri, 26 Jan 2024 22:10:57 +0800 Subject: [PATCH] added trust_remote_code to deepspeed init loaderClass (#5237) --- modules/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/models.py b/modules/models.py index e94dd12f..6c38c3c7 100644 --- a/modules/models.py +++ b/modules/models.py @@ -162,7 +162,7 @@ def huggingface_loader(model_name): # DeepSpeed ZeRO-3 elif shared.args.deepspeed: - model = LoaderClass.from_pretrained(path_to_model, torch_dtype=params['torch_dtype']) + model = LoaderClass.from_pretrained(path_to_model, torch_dtype=params['torch_dtype'], trust_remote_code=params['trust_remote_code']) model = deepspeed.initialize(model=model, config_params=ds_config, model_parameters=None, optimizer=None, lr_scheduler=None)[0] model.module.eval() # Inference logger.info(f'DeepSpeed ZeRO-3 is enabled: {is_deepspeed_zero3_enabled()}')