Spaces:
Runtime error
Runtime error
File size: 773 Bytes
2f8e7ab 5aa892d 2f8e7ab 5aa892d 2f8e7ab |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import os
from huggingface_hub import snapshot_download
def maybe_download_model(repo_id, local_dir):
if not os.path.exists(local_dir) or not os.listdir(local_dir):
print(f"📥 Downloading model from {repo_id} ...")
snapshot_download(
repo_id=repo_id,
local_dir=local_dir,
local_dir_use_symlinks=False
)
else:
print(f"✅ Model already exists at {local_dir}, skipping download.")
# تحميل النماذج فقط إذا ما كانت موجودة
maybe_download_model("Wan-AI/Wan2.1-I2V-14B-720P", "./models/Wan2.1-I2V-14B-720P")
maybe_download_model("facebook/wav2vec2-base-960h", "./models/wav2vec2-base-960h")
maybe_download_model("acvlab/FantasyTalking", "./models/fantasytalking_model")
|