hysts HF staff commited on
Commit
bda5c2d
β€’
1 Parent(s): 518857d
Files changed (2) hide show
  1. README.md +1 -1
  2. app.py +6 -6
README.md CHANGED
@@ -4,7 +4,7 @@ emoji: πŸ“š
4
  colorFrom: indigo
5
  colorTo: pink
6
  sdk: gradio
7
- sdk_version: 2.9.1
8
  app_file: app.py
9
  pinned: false
10
  ---
 
4
  colorFrom: indigo
5
  colorTo: pink
6
  sdk: gradio
7
+ sdk_version: 3.0.2
8
  app_file: app.py
9
  pinned: false
10
  ---
app.py CHANGED
@@ -14,9 +14,11 @@ from huggingface_hub import hf_hub_download
14
 
15
  from model import Model
16
 
17
- ORIGINAL_REPO_URL = 'https://github.com/bes-dev/MobileStyleGAN.pytorch'
18
  TITLE = 'bes-dev/MobileStyleGAN.pytorch'
19
- DESCRIPTION = f'This is a demo for {ORIGINAL_REPO_URL}.'
 
 
 
20
  SAMPLE_IMAGE_DIR = 'https://huggingface.co/spaces/hysts/MobileStyleGAN/resolve/main/samples'
21
  ARTICLE = f'''## Generated images
22
  ### FFHQ
@@ -24,6 +26,8 @@ ARTICLE = f'''## Generated images
24
  - seed: 0-99
25
  - truncation: 1.0
26
  ![FFHQ]({SAMPLE_IMAGE_DIR}/ffhq.jpg)
 
 
27
  '''
28
 
29
  TOKEN = os.environ['TOKEN']
@@ -40,7 +44,6 @@ def parse_args() -> argparse.Namespace:
40
  dest='enable_queue',
41
  action='store_false')
42
  parser.add_argument('--allow-flagging', type=str, default='never')
43
- parser.add_argument('--allow-screenshot', action='store_true')
44
  return parser.parse_args()
45
 
46
 
@@ -77,8 +80,6 @@ def load_model(device: torch.device) -> nn.Module:
77
 
78
 
79
  def main():
80
- gr.close_all()
81
-
82
  args = parse_args()
83
  device = torch.device(args.device)
84
 
@@ -103,7 +104,6 @@ def main():
103
  description=DESCRIPTION,
104
  article=ARTICLE,
105
  theme=args.theme,
106
- allow_screenshot=args.allow_screenshot,
107
  allow_flagging=args.allow_flagging,
108
  live=args.live,
109
  ).launch(
 
14
 
15
  from model import Model
16
 
 
17
  TITLE = 'bes-dev/MobileStyleGAN.pytorch'
18
+ DESCRIPTION = '''This is an unofficial demo for https://github.com/bes-dev/MobileStyleGAN.pytorch.
19
+
20
+ Expected execution time on Hugging Face Spaces: 1s
21
+ '''
22
  SAMPLE_IMAGE_DIR = 'https://huggingface.co/spaces/hysts/MobileStyleGAN/resolve/main/samples'
23
  ARTICLE = f'''## Generated images
24
  ### FFHQ
 
26
  - seed: 0-99
27
  - truncation: 1.0
28
  ![FFHQ]({SAMPLE_IMAGE_DIR}/ffhq.jpg)
29
+
30
+ <center><img src="https://visitor-badge.glitch.me/badge?page_id=hysts.mobilestylegan" alt="visitor badge"/></center>
31
  '''
32
 
33
  TOKEN = os.environ['TOKEN']
 
44
  dest='enable_queue',
45
  action='store_false')
46
  parser.add_argument('--allow-flagging', type=str, default='never')
 
47
  return parser.parse_args()
48
 
49
 
 
80
 
81
 
82
  def main():
 
 
83
  args = parse_args()
84
  device = torch.device(args.device)
85
 
 
104
  description=DESCRIPTION,
105
  article=ARTICLE,
106
  theme=args.theme,
 
107
  allow_flagging=args.allow_flagging,
108
  live=args.live,
109
  ).launch(