Datasets:
Tasks:
Text Generation
Modalities:
Text
Formats:
csv
Size:
< 1K
Tags:
scientific-hypothesis-generation
multi-agent-debate
knowledge-graph
diamond-nv-center
quantum-sensing
llm-as-judge
License:
Download scripts/upload_hf.py from eduzrh/nv-kgmad: direct link, hf CLI and curl.
- Browser
- Download file 1.38 kB
-
https://huggingface.co/datasets/eduzrh/nv-kgmad/resolve/main/scripts/upload_hf.py
- Command line
-
hf download hf://datasets/eduzrh/nv-kgmad/scripts/upload_hf.py
-
curl -L -o upload_hf.py https://huggingface.co/datasets/eduzrh/nv-kgmad/resolve/main/scripts/upload_hf.py
1.38 kB
| #!/usr/bin/env python3 | |
| """Upload the complete research artifact to a Hugging Face dataset repository. | |
| Usage: | |
| HF_TOKEN=hf_xxx python scripts/upload_hf.py [repo_id] | |
| The token is read from the environment and is never written to disk. | |
| """ | |
| from __future__ import annotations | |
| import os | |
| import sys | |
| from pathlib import Path | |
| from huggingface_hub import HfApi | |
| ROOT = Path(__file__).resolve().parents[1] | |
| DEFAULT_REPO = "eduzrh/nv-kgmad" | |
| IGNORE = [ | |
| "_internal/**", | |
| "logs/**", | |
| "**/__pycache__/**", | |
| "**/*.pyc", | |
| ".pytest_cache/**", | |
| "paper/math/**", | |
| ".git/**", | |
| ] | |
| def main() -> None: | |
| token = os.getenv("HF_TOKEN") or os.getenv("HUGGINGFACE_TOKEN") | |
| if not token: | |
| raise SystemExit("set HF_TOKEN in the environment") | |
| repo_id = sys.argv[1] if len(sys.argv) > 1 else DEFAULT_REPO | |
| api = HfApi(token=token) | |
| user = api.whoami()["name"] | |
| print("authenticated as", user) | |
| api.create_repo(repo_id=repo_id, repo_type="dataset", exist_ok=True, private=False) | |
| print("repo ready:", f"https://huggingface.co/datasets/{repo_id}") | |
| api.upload_folder( | |
| folder_path=str(ROOT), | |
| repo_id=repo_id, | |
| repo_type="dataset", | |
| ignore_patterns=IGNORE, | |
| commit_message="Upload NV-KGMAD code, data, cached responses, results and paper", | |
| ) | |
| print("upload complete") | |
| if __name__ == "__main__": | |
| main() |