From a5fdc8bf08f1ba01030265cac80d1822ea568ff1 Mon Sep 17 00:00:00 2001 From: smthemex <138738845+smthemex@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:49:41 +0800 Subject: [PATCH] if use cpu or lowram, need definition dtype to model fix --- InstantIR_node.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/InstantIR_node.py b/InstantIR_node.py index 61ae781..a8b1091 100644 --- a/InstantIR_node.py +++ b/InstantIR_node.py @@ -99,7 +99,9 @@ class InstantIR_Loader: previewer_lora_path,lora_path, aggregator_path, device) logging.info("loading checkpoint done.") + if low_vram and not torch.backends.mps.is_available(): + model.to(dtype=torch_dtype) model.enable_model_cpu_offload() #MPS not support else: model.to(device=device, dtype=torch_dtype)