minhalvp commited on
Commit
ccd56bc
·
1 Parent(s): 3e1b5b4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -8,7 +8,7 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
8
 
9
  @torch.inference_mode()
10
  def inference_gan():
11
- generator = torch.jit.load("models/mnist-G-torchscript.pt").to(device)
12
  x = torch.randn(30, 256, device='cuda')
13
  y = generator(x)
14
  y = y.view(-1, 1, 28, 28) # reshape y to have 1 channel
@@ -18,7 +18,7 @@ def inference_gan():
18
 
19
  @torch.inference_mode()
20
  def inference_dcgan():
21
- generator = torch.jit.load("models/animefacedataset-G2-torchscript.pt").to(device)
22
  def denorm(img_tensors):
23
  stats = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
24
  return img_tensors * stats[1][0] + stats[0][0]
 
8
 
9
  @torch.inference_mode()
10
  def inference_gan():
11
+ generator = torch.jit.load("mnist-G-torchscript.pt").to(device)
12
  x = torch.randn(30, 256, device='cuda')
13
  y = generator(x)
14
  y = y.view(-1, 1, 28, 28) # reshape y to have 1 channel
 
18
 
19
  @torch.inference_mode()
20
  def inference_dcgan():
21
+ generator = torch.jit.load("animefacedataset-G2-torchscript.pt").to(device)
22
  def denorm(img_tensors):
23
  stats = (0.5, 0.5, 0.5), (0.5, 0.5, 0.5)
24
  return img_tensors * stats[1][0] + stats[0][0]