Chaerin5 commited on
Commit
b61bdbb
·
1 Parent(s): d77d40d

enable zerogpu

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -505,15 +505,16 @@ def reset_kps(img, keypoints, side: Literal["right", "left"]):
505
  keypoints[1] = []
506
  return img, keypoints
507
 
508
- @spaces.GPU(duration=120)
509
  def sample_diff(ref_cond, target_cond, target_keypts, num_gen, seed, cfg):
510
  set_seed(seed)
511
  z = torch.randn(
512
  (num_gen, opts.latent_dim, opts.latent_size[0], opts.latent_size[1]),
513
  device=device,
514
  )
515
- target_cond = target_cond.repeat(num_gen, 1, 1, 1)
516
- ref_cond = ref_cond.repeat(num_gen, 1, 1, 1)
 
517
  # novel view synthesis mode = off
518
  nvs = torch.zeros(num_gen, dtype=torch.int, device=device)
519
  z = torch.cat([z, z], 0)
 
505
  keypoints[1] = []
506
  return img, keypoints
507
 
508
+ @spaces.GPU(duration=60)
509
  def sample_diff(ref_cond, target_cond, target_keypts, num_gen, seed, cfg):
510
  set_seed(seed)
511
  z = torch.randn(
512
  (num_gen, opts.latent_dim, opts.latent_size[0], opts.latent_size[1]),
513
  device=device,
514
  )
515
+ print(f"z.device: {z.device}")
516
+ target_cond = target_cond.repeat(num_gen, 1, 1, 1).to(z.device)
517
+ ref_cond = ref_cond.repeat(num_gen, 1, 1, 1).to(z.device)
518
  # novel view synthesis mode = off
519
  nvs = torch.zeros(num_gen, dtype=torch.int, device=device)
520
  z = torch.cat([z, z], 0)