Last active
March 4, 2025 02:06
-
-
Save geoabensur/ebd583809edcdd5df74f89e1f477a900 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from huggingface_hub import hf_hub_download, list_repo_files | |
repo_id = 'Wuvin/Unique3D' | |
repo_type = "space" | |
local_dir = "./ckpts" | |
# 1. List all files in the repository | |
files = list_repo_files(repo_id=repo_id, repo_type=repo_type) | |
# 2. Filter files that match your pattern (e.g., start with "ckpt/") | |
import os | |
matching_files = [f for f in files if f.startswith("ckpt/")] # Adjust "ckpt/" as needed | |
# 3. Create the local directory if it doesn't exist | |
os.makedirs(local_dir, exist_ok=True) | |
# 4. Download each matching file | |
for filename in matching_files: | |
try: | |
hf_hub_download( | |
repo_id=repo_id, | |
repo_type=repo_type, | |
filename=filename, | |
local_dir=local_dir, | |
) | |
print(f"Downloaded: {filename}") | |
except Exception as e: | |
print(f"Error downloading {filename}: {e}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment