Spaces:
Sleeping
Sleeping
| """ | |
| upload_gguf.py | |
| Uploads the final Q8_0 GGUF to the HF dataset repo using the Python API. | |
| Uses upload_large_file which handles chunking and retries automatically. | |
| """ | |
| import os | |
| from huggingface_hub import HfApi | |
| token = os.environ["HF_TOKEN"] | |
| repo = os.environ["HF_DATASET_REPO"] | |
| gguf = os.environ.get("GGUF_Q8", "/workspace/output/deepseek-math-v2-q8_0.gguf") | |
| fname = os.path.basename(gguf) | |
| api = HfApi(token=token) | |
| size_gb = os.path.getsize(gguf) / 1e9 | |
| print(f"Uploading {fname} ({size_gb:.1f} GB) to {repo}...") | |
| api.upload_file( | |
| path_or_fileobj=gguf, | |
| path_in_repo=fname, | |
| repo_id=repo, | |
| repo_type="dataset", | |
| ) | |
| print(f"Done: https://huggingface.co/datasets/{repo}") | |