Spaces:
Sleeping
Sleeping
File size: 695 Bytes
e27c01a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | """
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}")
|