if use cpu or lowram, need definition dtype to model

fix
This commit is contained in:
smthemex
2024-11-08 08:49:41 +08:00
committed by GitHub
parent 7067f0fd58
commit a5fdc8bf08
+2
View File
@@ -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)