The scripts are in the repository, not in the installed package. Clone it,
then
cd recipes/05-export/hugging-face before running the commands below. Browse this recipe on GitHub.With your own token
Nothing here calls the platform.huggingface_hub does the upload and
authenticates the way every HF library does: token=, else HF_TOKEN,
else the login hf auth login cached on the machine. Repos are private
until you say private=False: a training set or a checkpoint is not a
release until you say so.
load_dataset("me/my-set", split="train") and
PeftModel.from_pretrained(base, "me/my-lora"). The format="trl" file
carries no loss_mask; the export report’s mask_mode says what TRL will
train on (every token, or the last assistant turn for mask_mode="final").
Through the platform
Pushing through the platform is a platform feature: it moves a set that already lives on your account (ds_...) or a hosted run’s adapter
(run_...) through the Hugging Face account connected on the website, and
the SDK never sees that Hub token. One script, three calls. You need
WHILEAI_API_KEY and the connected account (the import half of the script
works on a public repo without the connection); a minute end to end.
Versions are commits. Every push is tagged with the While id it came
from, so
load_dataset(repo, split, revision="zp-ds_...") loads exactly
that push, and whileai.json in the repo maps each split to its dataset
with history. Pushing a new cut into the same split replaces the old parts
and the commit message carries the delta.
Run it
Connect your Hugging Face account once, on any dataset page at https://withwhile.com/platform/datasets (the platform holds the token, the SDK never sees it). Then:--repo-in ns/name --split train imports a different split; --keep leaves
the imported set on your account; --private makes the pushed dataset repo
private. Adapter repos are always pushed private: a checkpoint is not a
release.
Output for the import half:
--keep.
Every call in roundtrip.py is a request to the platform API
(WHILEAI_API_URL, default https://api.withwhile.com). That is how the
test suite exercises this script offline: it points WHILEAI_API_URL at a
local stub and checks the requests the script makes. See
tests/recipes/test_example_hugging_face.py. The local route above is the
one place the SDK talks to the Hub itself, and it does so with your token.