Create or reuse Hugging Face dataset PRs for `harborframework/parity-experiments` and upload Harbor parity/oracle result folders efficiently with sparse checkout, raw git pushes, and Git LFS.
Create or reuse Hugging Face dataset PRs for `harborframework/parity-experiments` and upload Harbor parity/oracle result folders efficiently with sparse checkout, raw git pushes, and Git LFS.
Upload Parity Experiments
Use this skill to publish Harbor parity experiment outputs to the shared Hugging Face dataset and capture the resulting discussion URL for the adapter's parity_pr field.
Why This Skill Exists
hf upload-large-folder can be slow or unreliable for large parity bundles because it pushes through the Hub API commit loop.
A normal git clone of harborframework/parity-experiments is too expensive because the dataset is very large.
Hugging Face dataset PR refs are different from GitHub PR refs and are easy to misuse.
Files larger than 10 MiB must be Git LFS-tracked before pushing.
This skill avoids the full clone by fetching only the target PR ref with --depth 1 --filter=blob:none and checking out only the paths needed for the current adapter.
Prereqs
Ensure Hugging Face authentication is available with discussion-write permission. Either a classic write token or a fine-grained token with global discussion.write enabled at https://huggingface.co/settings/tokens. A read-only or narrowly-scoped token will cause create_pr.py to fail with HTTP 403.
Keep the target dataset fixed to harborframework/parity-experiments unless the user explicitly asks for another repo.
Accept any local upload source that already contains the final files the user wants to publish.
Preferred Workflow
Create or reuse a dataset PR.
Prepare a sparse local worktree for that PR ref.
Copy the local parity results into the sparse checkout.
Ensure every file larger than 10 MiB is Git LFS-tracked before committing.
Push directly to the PR ref with raw git push.
Share the discussion URL and record it as the adapter's parity_pr.
For large parity bundles, prefer raw git over hf upload-large-folder. The raw git path is materially faster and more reliable because it avoids the API-side commit loop and does not require cloning the entire parity dataset.
1. Create Or Reuse A Dataset PR
If the user already has a parity PR number, reuse it.
Otherwise, create one with the bundled helper:
uv run python scripts/create_pr.py create-pr \
--title "Add parity experiments for <adapter_name>" \
--description-file /path/to/pr-description.md
The repo-root .gitattributes already LFS-tracks common binary, model, archive, and media extensions (*.bin, *.parquet, *.safetensors, images, audio, video, *.log, *.txt, etc.). Most parity outputs are covered automatically and need no manual action. Scan the sparse checkout for files larger than 10 MiB to catch anything that slipped through:
python - <<'PY'
from pathlib import Path
for path in sorted(Path(".").rglob("*")):
if path.is_file() and ".git" not in path.parts and path.stat().st_size > 10 * 1024 * 1024:
print(path)
PY
If any file is flagged and is not already covered by root, write the LFS rule to adapters/<adapter_name>/.gitattributes — never to the repo-root .gitattributes, which is a shared merge-conflict hotspot. Run git lfs track inside the adapter directory so the rule is written with a relative pattern: