提交 eef1990a 编写于 作者: B brkirch

Fix Approx NN on devices other than CUDA

上级 ebfdd7ba
...@@ -36,7 +36,7 @@ def model(): ...@@ -36,7 +36,7 @@ def model():
if sd_vae_approx_model is None: if sd_vae_approx_model is None:
sd_vae_approx_model = VAEApprox() sd_vae_approx_model = VAEApprox()
sd_vae_approx_model.load_state_dict(torch.load(os.path.join(paths.models_path, "VAE-approx", "model.pt"))) sd_vae_approx_model.load_state_dict(torch.load(os.path.join(paths.models_path, "VAE-approx", "model.pt"), map_location='cpu' if devices.device.type != 'cuda' else None))
sd_vae_approx_model.eval() sd_vae_approx_model.eval()
sd_vae_approx_model.to(devices.device, devices.dtype) sd_vae_approx_model.to(devices.device, devices.dtype)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册