Download upload_dataset.py from LoNebula/data-engineer-2026-ja: direct link, hf CLI and curl.
- Browser
- Download file 1.13 kB
-
https://huggingface.co/datasets/LoNebula/data-engineer-2026-ja/resolve/main/upload_dataset.py
- Command line
-
hf download hf://datasets/LoNebula/data-engineer-2026-ja/upload_dataset.py
-
curl -L -o upload_dataset.py https://huggingface.co/datasets/LoNebula/data-engineer-2026-ja/resolve/main/upload_dataset.py
1.13 kB
| """Publish the Japanese Data Engineer 2026 dataset (SFT + pretrain) with its English card.""" | |
| from __future__ import annotations | |
| import os | |
| from pathlib import Path | |
| from dotenv import load_dotenv | |
| from huggingface_hub import HfApi | |
| ROOT = Path(__file__).resolve().parents[3] | |
| DATA_DIR = ROOT / "dev/hf-de2026-dataset" | |
| REPO_ID = "LoNebula/data-engineer-2026-ja" | |
| def main() -> None: | |
| load_dotenv(ROOT / ".env") | |
| token = os.environ.get("HF_TOKEN") | |
| if not token: | |
| raise RuntimeError("HF_TOKEN is missing from the project environment") | |
| api = HfApi(token=token) | |
| api.create_repo(REPO_ID, repo_type="dataset", exist_ok=True, private=False) | |
| api.upload_folder( | |
| folder_path=str(DATA_DIR), | |
| repo_id=REPO_ID, | |
| repo_type="dataset", | |
| commit_message="Publish Japanese Data Engineer 2026 dataset (SFT + pretrain)", | |
| ) | |
| print(f"Published dataset: https://huggingface.co/datasets/{REPO_ID}") | |
| if __name__ == "__main__": | |
| try: | |
| main() | |
| except Exception as exc: | |
| raise SystemExit(f"Dataset upload failed ({type(exc).__name__}); details suppressed.") from None |