| """ | |
| 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() | |