KevinNg99 commited on
Commit
879b56c
·
1 Parent(s): 1881139
Files changed (1) hide show
  1. hyimage/models/vae/__init__.py +5 -1
hyimage/models/vae/__init__.py CHANGED
@@ -37,7 +37,11 @@ def load_refiner_vae(device, vae_path: str = None, vae_precision: str = "fp16"):
37
  config = AutoencoderKLConv3D.load_config(vae_path)
38
  vae = AutoencoderKLConv3D.from_config(config)
39
 
40
- ckpt = torch.load(Path(vae_path) / "pytorch_model.ckpt", map_location='cpu')
 
 
 
 
41
  if "state_dict" in ckpt:
42
  ckpt = ckpt["state_dict"]
43
  vae_ckpt = {}
 
37
  config = AutoencoderKLConv3D.load_config(vae_path)
38
  vae = AutoencoderKLConv3D.from_config(config)
39
 
40
+ ckpt_path = Path(vae_path) / "pytorch_model.ckpt"
41
+ if not ckpt_path.exists():
42
+ ckpt_path = Path(vae_path) / "pytorch_model.pt"
43
+
44
+ ckpt = torch.load(ckpt_path, map_location='cpu')
45
  if "state_dict" in ckpt:
46
  ckpt = ckpt["state_dict"]
47
  vae_ckpt = {}