root commited on
Commit
4738bab
·
1 Parent(s): 3a4efaa
Files changed (1) hide show
  1. handler.py +8 -1
handler.py CHANGED
@@ -47,8 +47,15 @@ class EndpointHandler():
47
 
48
  vae = AutoencoderKL.from_pretrained(config_path).to(device, dtype=self.weight_dtype)
49
 
 
 
 
 
 
 
 
50
  reference_unet = UNet2DConditionModel.from_pretrained(
51
- self.config.pretrained_base_model_path,
52
  subfolder="unet"
53
  ).to(device, dtype=self.weight_dtype)
54
 
 
47
 
48
  vae = AutoencoderKL.from_pretrained(config_path).to(device, dtype=self.weight_dtype)
49
 
50
+
51
+ pretrained_base_model_path = os.path.join(base_dir, 'pretrained_weights', 'stable-diffusion-v1-5')
52
+
53
+ # Ensure the path exists
54
+ if not os.path.exists(pretrained_base_model_path):
55
+ raise FileNotFoundError(f"The folder was not found at: {pretrained_base_model_path}")
56
+
57
  reference_unet = UNet2DConditionModel.from_pretrained(
58
+ pretrained_base_model_path,
59
  subfolder="unet"
60
  ).to(device, dtype=self.weight_dtype)
61