Every recipe here is a single, self-contained UV script
(PEP 723 inline metadata) that runs on Hugging Face Jobs in one command. No shared library, no packaging — one file
you can hf jobs uv run.
- Pick the folder that maps to the Hugging Face dataset repo it belongs to (folder name == repo name, e.g.
ocr/→uv-scripts/ocr). To start a brand-new domain, create a new folder. - Write the script with an inline PEP 723 dependency block and a docstring that shows a runnable
hf jobs uv runexample. - Open a PR. On merge to
main, the folder mirrors to its Hub repo automatically.
⛔ Never delete a file that exists on the Hub. The mirror removes Hub files that disappear from a folder. Maintainers: see AGENTS.md for the seed-then-flip rules and the superset gate.
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "datasets",
# "huggingface-hub[hf_transfer]",
# ]
# ///
"""One-line description of what this recipe does.
Example (Hugging Face Jobs):
hf jobs uv run --flavor l4x1 \
https://huggingface.co/datasets/uv-scripts/<repo>/raw/main/<script>.py \
input-dataset output-dataset
"""
import argparse
def main():
parser = argparse.ArgumentParser(description=__doc__)
# ...
args = parser.parse_args()
# ... core logic
if __name__ == "__main__":
main()- Self-contained: declare all deps inline; no
requirements.txt, no shared importable modules. - Hub-native I/O: read inputs from and write outputs to the Hub (
push_to_hub) or a bucket (-v hf://…). Job disk is ephemeral — never rely on local output paths. (Users can mount a local input folder with-v ./dir:/mnt, which syncs it to a bucket — scripts just see a mounted directory.) - GPU scripts: check
torch.cuda.is_available()and exit with a clear message if a GPU is required. - Fast downloads: prefer
huggingface-hub[hf_transfer]. - Naming: name by task, not tool (
classify-dataset.py, notbert-classify.py). - Per-folder README: each folder has a
README.mdwith frontmatterviewer: falseandtags: [uv-script, …](these are dataset repos hosting code, so the dataset viewer is disabled). - Examples use the HF raw URL
https://huggingface.co/datasets/uv-scripts/<repo>/raw/main/<script>.py— that's the invocation the Hub can attribute.