Chaerin5 commited on
Commit
04f7b3e
·
1 Parent(s): bcfe92f

enable zerogpu

Browse files
Files changed (2) hide show
  1. app.py +1 -1
  2. vqvae.py +0 -1
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