Spaces:
Running
on
Zero
Running
on
Zero
automatically download model
Browse files
app.py
CHANGED
|
@@ -38,18 +38,18 @@ def get_configs(num_steps=1, chopping_size=128, seed=12345):
|
|
| 38 |
print(f'Setting timesteps for inference: {configs.timesteps}')
|
| 39 |
|
| 40 |
# path to save noise predictor
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
configs.model_start.ckpt_path = started_ckpt_path
|
| 53 |
|
| 54 |
configs.bs = 1
|
| 55 |
configs.seed = 12345
|
|
|
|
| 38 |
print(f'Setting timesteps for inference: {configs.timesteps}')
|
| 39 |
|
| 40 |
# path to save noise predictor
|
| 41 |
+
started_ckpt_name = "noise_predictor_sd_turbo_v5.pth"
|
| 42 |
+
started_ckpt_dir = "./weights"
|
| 43 |
+
util_common.mkdir(started_ckpt_dir, delete=False, parents=True)
|
| 44 |
+
started_ckpt_path = Path(started_ckpt_dir) / started_ckpt_name
|
| 45 |
+
if not started_ckpt_path.exists():
|
| 46 |
+
load_file_from_url(
|
| 47 |
+
url="https://huggingface.co/OAOA/InvSR/resolve/main/noise_predictor_sd_turbo_v5.pth",
|
| 48 |
+
model_dir=started_ckpt_dir,
|
| 49 |
+
progress=True,
|
| 50 |
+
file_name=started_ckpt_name,
|
| 51 |
+
)
|
| 52 |
+
configs.model_start.ckpt_path = str(started_ckpt_path)
|
| 53 |
|
| 54 |
configs.bs = 1
|
| 55 |
configs.seed = 12345
|