Spaces:
Paused
Paused
Commit ·
461fa16
1
Parent(s): ea0a063
change download method
Browse files1417 unmodified lines14181419142014211422142314241425142614271428142914301431143214331434143514361 unmodified line143814391440144114421443144414451446144714481449145014511452145314541455145614571417 unmodified linesdef download_required_files():import subprocess# 1. Download "checkpoints" directory from huggingface.co/gdhe17/Self-Forcingif not os.path.exists("checkpoints"):print("Downloading checkpoints from gdhe17/Self-Forcing...")subprocess.run(["huggingface-cli", "download","gdhe17/Self-Forcing","--include", "checkpoints/*","--local-dir", ".",],check=True,)# 2. Download Wan-AI/Wan2.1-T2V-1.3B and place in wan_models/Wan2.1-T2V-1.3B1 unmodified lineif not os.path.exists(wan_model_dir):print("Downloading Wan-AI/Wan2.1-T2V-1.3B...")os.makedirs("wan_models", exist_ok=True)subprocess.run(["huggingface-cli", "download","Wan-AI/Wan2.1-T2V-1.3B","--local-dir", wan_model_dir,],check=True,)# 3. Download SAM ViT-H checkpointsam_checkpoint_path = "sam_vit_h_4b8939.pth"if not os.path.exists(sam_checkpoint_path):print("Downloading SAM ViT-H checkpoint...")import urllib.requesturllib.request.urlretrieve("https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth",sam_checkpoint_path,1417 unmodified lines14181419142014211422142314241425142614271428142914301431143214331 unmodified line1435143614371438143914401441144214431444144514461447144814491417 unmodified linesdef download_required_files():from huggingface_hub import snapshot_downloadimport urllib.request# 1. Download "checkpoints" directory from gdhe17/Self-Forcingif not os.path.exists("checkpoints"):print("Downloading checkpoints from gdhe17/Self-Forcing...")snapshot_download(repo_id="gdhe17/Self-Forcing",allow_patterns=["checkpoints/*"],local_dir=".",)# 2. Download Wan-AI/Wan2.1-T2V-1.3B and place in wan_models/Wan2.1-T2V-1.3B1 unmodified lineif not os.path.exists(wan_model_dir):print("Downloading Wan-AI/Wan2.1-T2V-1.3B...")os.makedirs("wan_models", exist_ok=True)snapshot_download(repo_id="Wan-AI/Wan2.1-T2V-1.3B",local_dir=wan_model_dir,)# 3. Download SAM ViT-H checkpointsam_checkpoint_path = "sam_vit_h_4b8939.pth"if not os.path.exists(sam_checkpoint_path):print("Downloading SAM ViT-H checkpoint...")urllib.request.urlretrieve("https://dl.fbaipublicfiles.com/segment_anything/sam_vit_h_4b8939.pth",sam_checkpoint_path,
app.py+10-18