hysts HF staff commited on
Commit
2ee6873
·
1 Parent(s): 4b1ebb6

Change the way to apply patch

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -15,7 +15,8 @@ import torch.nn as nn
15
  from huggingface_hub import hf_hub_download
16
 
17
  if os.environ.get('SYSTEM') == 'spaces':
18
- subprocess.call('git apply ../patch'.split(), cwd='stylegan2-pytorch')
 
19
 
20
  sys.path.insert(0, 'stylegan2-pytorch')
21
 
 
15
  from huggingface_hub import hf_hub_download
16
 
17
  if os.environ.get('SYSTEM') == 'spaces':
18
+ with open('patch') as f:
19
+ subprocess.run('patch -p1'.split(), cwd='stylegan2-pytorch', stdin=f)
20
 
21
  sys.path.insert(0, 'stylegan2-pytorch')
22