Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -134,7 +134,7 @@ class DiffusionModel(nn.Module):
|
|
134 |
self.alphas = 1. - self.betas
|
135 |
self.register_buffer('alpha_bars', torch.cumprod(self.alphas, dim=0))
|
136 |
|
137 |
-
|
138 |
def sample(model, num_images, timesteps, img_size, num_classes, labels, device, progress_callback=None):
|
139 |
# Initialize with properly scaled noise
|
140 |
x_t = torch.randn((num_images, 3, img_size, img_size), device=device) * 0.5 # Reduced initial noise scale
|
|
|
134 |
self.alphas = 1. - self.betas
|
135 |
self.register_buffer('alpha_bars', torch.cumprod(self.alphas, dim=0))
|
136 |
|
137 |
+
@torch.no_grad()
|
138 |
def sample(model, num_images, timesteps, img_size, num_classes, labels, device, progress_callback=None):
|
139 |
# Initialize with properly scaled noise
|
140 |
x_t = torch.randn((num_images, 3, img_size, img_size), device=device) * 0.5 # Reduced initial noise scale
|