helloworld-S commited on
Commit
718f5e2
·
verified ·
1 Parent(s): 6a6a21f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -33,7 +33,7 @@ import shutil
33
  import yaml
34
  import numpy as np
35
 
36
- from huggingface_hub import hf_hub_download
37
 
38
  print(os.getcwd())
39
  os.environ["TORCH_HOME"] = os.path.join(os.getcwd(), "checkpoints")
@@ -57,8 +57,7 @@ config = get_train_config(config_path)
57
  model.config = config
58
  store_attn_map = False
59
 
60
- file_path = hf_hub_download(repo_id="ByteDance/XVerse", force_download=False)
61
- ckpt_root = os.path.dirname(file_path)
62
 
63
  modulation_adapter = load_modulation_adapter(model, config, dtype, device, f"{ckpt_root}/modulation_adapter", is_training=False)
64
  model.add_modulation_adapter(modulation_adapter)
 
33
  import yaml
34
  import numpy as np
35
 
36
+ from huggingface_hub import snapshot_download
37
 
38
  print(os.getcwd())
39
  os.environ["TORCH_HOME"] = os.path.join(os.getcwd(), "checkpoints")
 
57
  model.config = config
58
  store_attn_map = False
59
 
60
+ ckpt_root = snapshot_download(repo_id="ByteDance/XVerse")
 
61
 
62
  modulation_adapter = load_modulation_adapter(model, config, dtype, device, f"{ckpt_root}/modulation_adapter", is_training=False)
63
  model.add_modulation_adapter(modulation_adapter)