root commited on
Commit
256a090
·
1 Parent(s): 43d63ec

changing sd-vae-ft-mse path

Browse files
Files changed (1) hide show
  1. handler.py +7 -1
handler.py CHANGED
@@ -39,7 +39,13 @@ class EndpointHandler():
39
  self._initialize_pipeline()
40
 
41
  def _initialize_pipeline(self):
42
- vae = AutoencoderKL.from_pretrained('./pretrained_weights/sd-vae-ft-mse').to(device, dtype=self.weight_dtype)
 
 
 
 
 
 
43
 
44
  reference_unet = UNet2DConditionModel.from_pretrained(
45
  self.config.pretrained_base_model_path,
 
39
  self._initialize_pipeline()
40
 
41
  def _initialize_pipeline(self):
42
+ base_dir = os.path.dirname(os.path.abspath(__file__))
43
+ config_path = os.path.join(base_dir, 'pretrained_weights', 'sd-vae-ft-mse')
44
+
45
+ if not os.path.exists(config_path):
46
+ raise FileNotFoundError(f"The sd-vae-ft-mse folder was not found at: {config_path}")
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,