Spaces:
Runtime error
Runtime error
Songwei Ge
commited on
Commit
•
3430584
1
Parent(s):
2031452
demo
Browse files
models/region_diffusion.py
CHANGED
@@ -36,15 +36,6 @@ class RegionDiffusion(nn.Module):
|
|
36 |
self.unet = UNet2DConditionModel.from_pretrained(
|
37 |
model_id, subfolder="unet").to(self.device)
|
38 |
|
39 |
-
if save_pretrained:
|
40 |
-
self.vae.save_pretrained(os.path.join(local_pretrained_dir, 'vae'))
|
41 |
-
self.tokenizer.save_pretrained(
|
42 |
-
os.path.join(local_pretrained_dir, 'tokenizer'))
|
43 |
-
self.text_encoder.save_pretrained(
|
44 |
-
os.path.join(local_pretrained_dir, 'text_encoder'))
|
45 |
-
self.unet.save_pretrained(
|
46 |
-
os.path.join(local_pretrained_dir, 'unet'))
|
47 |
-
|
48 |
self.scheduler = PNDMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear",
|
49 |
num_train_timesteps=self.num_train_timesteps, skip_prk_steps=True, steps_offset=1)
|
50 |
self.alphas_cumprod = self.scheduler.alphas_cumprod.to(self.device)
|
|
|
36 |
self.unet = UNet2DConditionModel.from_pretrained(
|
37 |
model_id, subfolder="unet").to(self.device)
|
38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
self.scheduler = PNDMScheduler(beta_start=0.00085, beta_end=0.012, beta_schedule="scaled_linear",
|
40 |
num_train_timesteps=self.num_train_timesteps, skip_prk_steps=True, steps_offset=1)
|
41 |
self.alphas_cumprod = self.scheduler.alphas_cumprod.to(self.device)
|