ldkong commited on
Commit
6ca20c1
β€’
1 Parent(s): 42ef983

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -29,17 +29,9 @@ class Generator(nn.Module):
29
  return output
30
 
31
 
32
- model = Generator()
33
- weights_path = hf_hub_download('nateraw/cryptopunks-gan', 'generator.pth')
34
- model.load_state_dict(torch.load(weights_path, map_location=torch.device('cpu'))) # Use 'cuda' if you have a GPU available
35
-
36
-
37
- def predict(seed, num_punks):
38
- torch.manual_seed(seed)
39
- z = torch.randn(num_punks, 100, 1, 1)
40
- punks = model(z)
41
- save_image(punks, "punks.png", normalize=True)
42
- return 'punks.png'
43
 
44
  gr.Interface(
45
  predict,
@@ -49,7 +41,6 @@ gr.Interface(
49
  gr.Slider(0, 3, label='Top', step=1, default=0),
50
  gr.Slider(0, 4, label='Bottom', step=1, default=0),
51
  ],
52
- outputs="image",
53
- examples=[[123, 15], [42, 29], [456, 8], [1337, 35]],
54
  live=True,
55
  ).launch(cache_examples=True)
 
29
  return output
30
 
31
 
32
+ def predict(body, hair, top, bottom):
33
+ name = str(body) + str(hair) + str(top) + str(bottom)
34
+ return name
 
 
 
 
 
 
 
 
35
 
36
  gr.Interface(
37
  predict,
 
41
  gr.Slider(0, 3, label='Top', step=1, default=0),
42
  gr.Slider(0, 4, label='Bottom', step=1, default=0),
43
  ],
44
+ outputs="name",
 
45
  live=True,
46
  ).launch(cache_examples=True)