encounter1997 commited on
Commit
2a841b2
Β·
1 Parent(s): 7419fe8

git init before git lfs

Browse files
Files changed (1) hide show
  1. gradio_demo/runner.py +5 -4
gradio_demo/runner.py CHANGED
@@ -29,14 +29,14 @@ class Runner:
29
 
30
  def download_base_model(self, base_model_id: str, token=None) -> str:
31
  model_dir = self.checkpoint_dir / base_model_id
 
 
32
  if not model_dir.exists():
33
- org_name = base_model_id.split('/')[0]
34
- org_dir = self.checkpoint_dir / org_name
35
  org_dir.mkdir(exist_ok=True)
36
  print(f'https://huggingface.co/{base_model_id}')
37
  if token == None:
38
- subprocess.run(shlex.split(f'git lfs install'),
39
- cwd=org_dir)
40
  subprocess.run(shlex.split(
41
  f'git lfs clone https://huggingface.co/{base_model_id}'),
42
  cwd=org_dir)
@@ -90,6 +90,7 @@ class Runner:
90
  output_dir.mkdir(parents=True, exist_ok=True)
91
 
92
  config = OmegaConf.load('configs/black-swan.yaml')
 
93
  config.pretrained_model_path = self.download_base_model(model_path, token=input_token)
94
 
95
  # we remove null-inversion & use fp16 for fast inference on web demo
 
29
 
30
  def download_base_model(self, base_model_id: str, token=None) -> str:
31
  model_dir = self.checkpoint_dir / base_model_id
32
+ org_name = base_model_id.split('/')[0]
33
+ org_dir = self.checkpoint_dir / org_name
34
  if not model_dir.exists():
 
 
35
  org_dir.mkdir(exist_ok=True)
36
  print(f'https://huggingface.co/{base_model_id}')
37
  if token == None:
38
+ subprocess.run(shlex.split(f'git init'), cwd=org_dir)
39
+ subprocess.run(shlex.split(f'git lfs install'), cwd=org_dir)
40
  subprocess.run(shlex.split(
41
  f'git lfs clone https://huggingface.co/{base_model_id}'),
42
  cwd=org_dir)
 
90
  output_dir.mkdir(parents=True, exist_ok=True)
91
 
92
  config = OmegaConf.load('configs/black-swan.yaml')
93
+ import pdb; pdb.set_trace()
94
  config.pretrained_model_path = self.download_base_model(model_path, token=input_token)
95
 
96
  # we remove null-inversion & use fp16 for fast inference on web demo