mkaraki commited on
Commit
2d200d3
·
1 Parent(s): d406a66

Change code for huggingface

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -38,7 +38,7 @@ beta1 = 0.5
38
  ngpu = 0
39
 
40
 
41
- device = torch.device("cuda:0" if (torch.cuda.is_available() and ngpu > 0) else "cpu")
42
 
43
 
44
  # custom weights initialization called on netG and netD
@@ -86,7 +86,7 @@ class Generator(nn.Module):
86
  netG = Generator(ngpu).to(device)
87
 
88
  # Handle multi-gpu if desired
89
- if (device.type == 'cuda') and (ngpu > 1):
90
  netG = nn.DataParallel(netG, list(range(ngpu)))
91
 
92
  # Apply the weights_init function to randomly initialize all weights
 
38
  ngpu = 0
39
 
40
 
41
+ device = torch.device("cuda:0" if (ngpu > 0 and torch.cuda.is_available()) else "cpu")
42
 
43
 
44
  # custom weights initialization called on netG and netD
 
86
  netG = Generator(ngpu).to(device)
87
 
88
  # Handle multi-gpu if desired
89
+ if (ngpu > 1) and (device.type == 'cuda'):
90
  netG = nn.DataParallel(netG, list(range(ngpu)))
91
 
92
  # Apply the weights_init function to randomly initialize all weights