bloxy-data-v1 / code /scripts /publish_hf.py
Radinkazemian's picture
Update Bloxy training code
6da8440 verified
Raw History Blame Contribute Delete
1.88 kB
"""Uploads the built dataset AND the training code to one private HF dataset repo.
The RunPod/Kaggle machines then only need your HF token to get everything:
hf download <repo> --repo-type dataset --local-dir bloxy
HF_TOKEN=... python scripts/publish_hf.py --repo YOURNAME/bloxy-data-v1
"""
from __future__ import annotations
import argparse
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
CARD = """---
license: other
private: true
tags: [roblox, luau, building, gemma, bloxy]
---
# Bloxy v1 training data
Chat-format training set for **Bloxy**, a Gemma 4 fine-tune that builds and scripts in
Roblox Studio. Built by `scripts/build_dataset.py` from 19 public datasets plus
procedurally generated Roblox builds. See `stats.json` for the mix and
`masked_samples.md` for what the model is trained on.
Each source keeps its own license; check them before any commercial use.
"""
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--repo", required=True)
ap.add_argument("--out", default=str(ROOT / "out"))
args = ap.parse_args()
from huggingface_hub import HfApi
api = HfApi()
api.create_repo(args.repo, repo_type="dataset", private=True, exist_ok=True)
(Path(args.out) / "README.md").write_text(CARD)
api.upload_folder(
repo_id=args.repo, repo_type="dataset", folder_path=args.out,
allow_patterns=["*.jsonl", "*.jsonl.gz", "*.json", "*.md", "*.txt"],
commit_message="Update Bloxy dataset",
)
api.upload_folder(
repo_id=args.repo, repo_type="dataset", folder_path=str(ROOT), path_in_repo="code",
allow_patterns=["bloxy_data/*.py", "scripts/*.py", "runpod/*", "eval/*", "requirements*.txt"],
commit_message="Update Bloxy training code",
)
print(f"https://huggingface.co/datasets/{args.repo}")
if __name__ == "__main__":
main()