SerdarHelli commited on
Commit
c1a6745
1 Parent(s): d90e4c1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -6,6 +6,8 @@ import torch
6
  from tqdm import tqdm
7
  import gradio as gr
8
  from huggingface_hub import hf_hub_download
 
 
9
 
10
  def layout_grid(img, grid_w=None, grid_h=1, float_to_uint8=True, chw_to_hwc=True, to_numpy=True):
11
  batch_size, channels, img_h, img_w = img.shape
@@ -24,9 +26,12 @@ def layout_grid(img, grid_w=None, grid_h=1, float_to_uint8=True, chw_to_hwc=True
24
  return img
25
 
26
 
 
 
27
 
 
28
 
29
- network_pkl=hf_hub_download('SerdarHelli/BrainMRIGAN','models/braingan-400.pkl')
30
  with open(network_pkl, 'rb') as f:
31
  G = pickle.load(f)['G_ema']
32
 
 
6
  from tqdm import tqdm
7
  import gradio as gr
8
  from huggingface_hub import hf_hub_download
9
+ import sys
10
+
11
 
12
  def layout_grid(img, grid_w=None, grid_h=1, float_to_uint8=True, chw_to_hwc=True, to_numpy=True):
13
  batch_size, channels, img_h, img_w = img.shape
 
26
  return img
27
 
28
 
29
+ sys.path.insert(0, 'stylegan_xl')
30
+
31
 
32
+ TOKEN = os.environ['TOKEN']
33
 
34
+ network_pkl=hf_hub_download('SerdarHelli/BrainMRIGAN',f'models/braingan-400.pkl',use_auth_token=TOKEN)
35
  with open(network_pkl, 'rb') as f:
36
  G = pickle.load(f)['G_ema']
37