| import argparse, os |
| from huggingface_hub import create_repo, HfApi |
|
|
| p = argparse.ArgumentParser() |
| p.add_argument("--repo", required=True, help="e.g. yourname/ib-physics-mini-gpt") |
| args = p.parse_args() |
|
|
| api = HfApi() |
| try: |
| create_repo(repo_id=args.repo, exist_ok=True) |
| except Exception: |
| pass |
|
|
| os.system("git init") |
| os.system(f"git remote add origin https://huggingface.co/{args.repo}") |
| os.system("git lfs install") |
| os.system("git add .") |
| os.system('git commit -m "initial commit: tiny from-scratch gpt + space"') |
| os.system("git push -u origin HEAD:main --force") |
| print("Pushed to HF:", args.repo) |
|
|