.serva datasets to the Hugging Face Hub and pull them back later. The Hub support ships with serva so there is nothing extra to install.
Authentication
Set your Hugging Face token asHF_TOKEN or pass hf_token= when you build the client.
Push
Encode a file, then push the result to a dataset repo. The repo is created if it does not exist, andpush returns its URL.
EncodeResult lets the dataset card show the compression savings. A plain file path works too, and the card leaves the savings out.
private=True to create a private dataset repo.
Pushing writes a
README.md dataset card next to the file with the encoded
size, the original size, and the savings, plus a short snippet showing how to
pull and decode it.Pull
Download a.serva file from a dataset repo. pull returns the local path, which you can hand straight to decode.
revision= to pull from a specific branch, tag, or commit. It defaults to main.
List
List the dataset repos owned by the authenticated user.A failed Hub operation raises
HubError, for example a missing token, a repo
that does not exist, or one you cannot reach.
