Spaces:
Runtime error
Runtime error
Commit ·
5914cbe
1
Parent(s): 47163f5
Fix syntax error in wget
Browse files
model.py
CHANGED
|
@@ -62,13 +62,19 @@ class Model:
|
|
| 62 |
def download_models(self) -> None:
|
| 63 |
self.model_dir.mkdir(exist_ok=True, parents=True)
|
| 64 |
device = 'cuda'
|
| 65 |
-
|
|
|
|
|
|
|
| 66 |
config = OmegaConf.load("config_sketch.yaml")
|
| 67 |
config.model.params.cond_stage_config.params.device = device
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
|
| 73 |
model = load_model_from_config(config, "models/sd-v1-4.ckpt").to(device)
|
| 74 |
current_base = 'sd-v1-4.ckpt'
|
|
|
|
| 62 |
def download_models(self) -> None:
|
| 63 |
self.model_dir.mkdir(exist_ok=True, parents=True)
|
| 64 |
device = 'cuda'
|
| 65 |
+
|
| 66 |
+
config_file = config_path+'test_sketch.yaml'
|
| 67 |
+
subprocess.run(shlex.split(f'wget {config_file} -O config_sketch.yaml'))
|
| 68 |
config = OmegaConf.load("config_sketch.yaml")
|
| 69 |
config.model.params.cond_stage_config.params.device = device
|
| 70 |
|
| 71 |
+
base_model_file = model_path+"sd-v1-4.ckpt"
|
| 72 |
+
sketch_adapter_file = model_path+"t2iadapter_sketch_sd14v1.pth"
|
| 73 |
+
pidinet_file = model_path+"table5_pidinet.pth"
|
| 74 |
+
|
| 75 |
+
subprocess.run(shlex.split(f'wget {base_model_file} -O models/sd-v1-4.ckpt'))
|
| 76 |
+
subprocess.run(shlex.split(f'wget {sketch_adapter_file} -O models/t2iadapter_sketch_sd14v1.pth'))
|
| 77 |
+
subprocess.run(shlex.split(f'wget {pidinet_file} -O models/table5_pidinet.pth'))
|
| 78 |
|
| 79 |
model = load_model_from_config(config, "models/sd-v1-4.ckpt").to(device)
|
| 80 |
current_base = 'sd-v1-4.ckpt'
|