feng2022 commited on
Commit
a203842
1 Parent(s): 24a6b38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -23,6 +23,7 @@ Related App: [StyleGAN-Human (Interpolation)](https://huggingface.co/spaces/hyst
23
  '''
24
  ARTICLE = '<center><img src="https://visitor-badge.glitch.me/badge?page_id=hysts.stylegan-human" alt="visitor badge"/></center>'
25
 
 
26
 
27
 
28
  def parse_args() -> argparse.Namespace:
@@ -59,7 +60,8 @@ def generate_image(seed: int, truncation_psi: float, model: nn.Module,
59
 
60
  def load_model(file_name: str, device: torch.device) -> nn.Module:
61
  path = hf_hub_download('hysts/StyleGAN-Human',
62
- f'models/{file_name}')
 
63
  with open(path, 'rb') as f:
64
  model = pickle.load(f)['G_ema']
65
  model.eval()
 
23
  '''
24
  ARTICLE = '<center><img src="https://visitor-badge.glitch.me/badge?page_id=hysts.stylegan-human" alt="visitor badge"/></center>'
25
 
26
+ TOKEN = os.environ['TOKEN']
27
 
28
 
29
  def parse_args() -> argparse.Namespace:
 
60
 
61
  def load_model(file_name: str, device: torch.device) -> nn.Module:
62
  path = hf_hub_download('hysts/StyleGAN-Human',
63
+ f'models/{file_name}',
64
+ use_auth_token=TOKEN)
65
  with open(path, 'rb') as f:
66
  model = pickle.load(f)['G_ema']
67
  model.eval()