File size: 604 Bytes
67a4742 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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)
|