From 9fbd60bf22c6a2e9cef0cade23a4933547df9114 Mon Sep 17 00:00:00 2001 From: deepdiffuser Date: Fri, 10 Mar 2023 05:30:47 -0800 Subject: [PATCH] add no_split_module_classes to prevent tensor split error --- modules/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/models.py b/modules/models.py index 14443c89..986cd73a 100644 --- a/modules/models.py +++ b/modules/models.py @@ -118,7 +118,7 @@ def load_model(model_name): max_memory['cpu'] = f"{shared.args.cpu_memory or '99'}GiB" import accelerate - device_map = accelerate.infer_auto_device_map(model, max_memory=max_memory) + device_map = accelerate.infer_auto_device_map(model, max_memory=max_memory, no_split_module_classes=["LLaMADecoderLayer"]) model = accelerate.dispatch_model(model, device_map=device_map) else: model = model.to(torch.device('cuda:0'))