from __future__ import annotations import getpass import os from pathlib import Path from huggingface_hub import HfApi ROOT = Path(__file__).resolve().parent REPO_ID = "smashburger-dev/Final_Assignment_Template" def main() -> None: token = os.getenv("HF_TOKEN", "").strip() or getpass.getpass("HF token: ").strip() if not token: raise SystemExit("Missing token") api = HfApi(token=token) api.upload_folder( repo_id=REPO_ID, repo_type="space", folder_path=str(ROOT), ignore_patterns=[ ".venv/**", "__pycache__/**", "data/**", "answers.local.json", "*.pyc", ".env", ], commit_message="Add GAIA Unit 4 workbench", ) print(f"Uploaded to https://huggingface.co/spaces/{REPO_ID}/tree/main") if __name__ == "__main__": main()