Update app.py
Browse files
app.py
CHANGED
@@ -11,28 +11,25 @@ import traceback
|
|
11 |
# =========================================
|
12 |
# 1. Define Hugging Face weights and paths
|
13 |
# =========================================
|
|
|
14 |
|
15 |
-
|
16 |
-
WEIGHT_FILES = {
|
17 |
-
"FVSM/FloVD_FVSM_Controlnet.pt": "FVSM/FloVD_FVSM_Controlnet.pt",
|
18 |
-
"OMSM/selected_blocks.safetensors": "OMSM/selected_blocks.safetensors",
|
19 |
-
"OMSM/pytorch_lora_weights.safetensors": "OMSM/pytorch_lora_weights.safetensors",
|
20 |
-
"others/depth_anything_v2_metric_hypersim_vitb.pth": "others/depth_anything_v2_metric_hypersim_vitb.pth"
|
21 |
-
}
|
22 |
|
23 |
def download_weights():
|
24 |
-
print("π Downloading model weights...")
|
25 |
for rel_path in WEIGHT_FILES.values():
|
26 |
-
|
27 |
-
if not
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
32 |
else:
|
33 |
-
print(f"β
Already exists: {
|
34 |
-
|
35 |
-
download_weights()
|
36 |
|
37 |
from inference.flovd_demo import generate_video
|
38 |
|
|
|
11 |
# =========================================
|
12 |
# 1. Define Hugging Face weights and paths
|
13 |
# =========================================
|
14 |
+
from huggingface_hub import hf_hub_download
|
15 |
|
16 |
+
HF_DATASET_REPO = "roll-ai/FloVD-weights" # dataset repo ID
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
def download_weights():
|
19 |
+
print("π Downloading model weights via huggingface_hub...")
|
20 |
for rel_path in WEIGHT_FILES.values():
|
21 |
+
local_path = Path("ckpt") / rel_path
|
22 |
+
if not local_path.exists():
|
23 |
+
print(f"π₯ Downloading {rel_path}")
|
24 |
+
hf_hub_download(
|
25 |
+
repo_id=HF_DATASET_REPO,
|
26 |
+
repo_type="dataset",
|
27 |
+
filename=rel_path,
|
28 |
+
local_dir="ckpt",
|
29 |
+
local_dir_use_symlinks=False,
|
30 |
+
)
|
31 |
else:
|
32 |
+
print(f"β
Already exists: {local_path}")
|
|
|
|
|
33 |
|
34 |
from inference.flovd_demo import generate_video
|
35 |
|