File size: 1,268 Bytes
5ddd413
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
"""
Upload evoneural code and config to Hugging Face (no weights/outputs).
Run from project root: python -m scripts.upload_to_hf

Requires: pip install huggingface_hub, and HF token (huggingface-cli login or HF_TOKEN).
"""
from pathlib import Path

REPO_ID = "evoneural/evoneuralIn3D"
ROOT = Path(__file__).resolve().parent.parent

# Same exclusions as .huggingfaceignore so only code/config are uploaded
IGNORE_PATTERNS = [
    ".venv/*",
    "venv/*",
    "env/*",
    "__pycache__/*",
    "*.pyc",
    "outputs/*",
    "weights/*",
    "*.obj",
    "*.glb",
    "*.png",
    "TripoSR/*",
    "*.ckpt",
    "*.safetensors",
    "*.bin",
    ".idea/*",
    ".vscode/*",
    ".streamlit/*",
    "*.log",
    "performance_log.txt",
    ".git/*",
]


def main() -> None:
    from huggingface_hub import HfApi

    api = HfApi()
    # Create repo if it doesn't exist (needs write token)
    api.create_repo(repo_id=REPO_ID, repo_type="model", exist_ok=True)
    print(f"Uploading to {REPO_ID} (code and config only)...")
    api.upload_folder(
        folder_path=str(ROOT),
        repo_id=REPO_ID,
        repo_type="model",
        ignore_patterns=IGNORE_PATTERNS,
    )
    print(f"Done. See https://huggingface.co/{REPO_ID}")


if __name__ == "__main__":
    main()