Spaces:
Running
on
Zero
Running
on
Zero
enable zerogpu
Browse files
app.py
CHANGED
@@ -261,7 +261,7 @@ def make_ref_cond(
|
|
261 |
):
|
262 |
print("ready to run autoencoder")
|
263 |
# print(f"image.device: {image.device}, type(image): {type(image)}")
|
264 |
-
image = image.to("cuda")
|
265 |
latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
|
266 |
return image[None, ...], latent
|
267 |
|
|
|
261 |
):
|
262 |
print("ready to run autoencoder")
|
263 |
# print(f"image.device: {image.device}, type(image): {type(image)}")
|
264 |
+
# image = image.to("cuda")
|
265 |
latent = opts.latent_scaling_factor * autoencoder.encode(image[None, ...]).sample()
|
266 |
return image[None, ...], latent
|
267 |
|
vqvae.py
CHANGED
@@ -49,7 +49,6 @@ class Autoencoder(nn.Module):
|
|
49 |
# embedding space
|
50 |
self.post_quant_conv = nn.Conv2d(emb_channels, z_channels, 1)
|
51 |
|
52 |
-
@spaces.GPU
|
53 |
def encode(self, img: torch.Tensor) -> "GaussianDistribution":
|
54 |
"""
|
55 |
### Encode images to latent representation
|
|
|
49 |
# embedding space
|
50 |
self.post_quant_conv = nn.Conv2d(emb_channels, z_channels, 1)
|
51 |
|
|
|
52 |
def encode(self, img: torch.Tensor) -> "GaussianDistribution":
|
53 |
"""
|
54 |
### Encode images to latent representation
|