davanstrien HF Staff commited on
Commit
9a70704
Β·
verified Β·
1 Parent(s): 7b9fbe0

Sync from GitHub via hub-sync

Browse files
Files changed (1) hide show
  1. README.md +38 -27
README.md CHANGED
@@ -9,21 +9,25 @@ pinned: false
9
 
10
  # UV Scripts
11
 
12
- **Run a data or ML task over a Hugging Face dataset in one command β€” for humans and agents.**
13
 
14
- Each recipe is a single self-contained [UV script](https://docs.astral.sh/uv/guides/scripts/): dependencies are declared inline, so you run it straight from a URL β€” no clone, no virtualenv, no `pip install`. Run it locally with `uv run`, or hand it to [Hugging Face Jobs](https://huggingface.co/docs/hub/jobs) for a managed GPU. Most recipes read a Hub dataset and write a new one, so they chain into pipelines.
15
 
16
  ## Quickstart
17
 
18
- For GPU runs, [install the `hf` CLI and sign in](https://huggingface.co/docs/hub/jobs-quickstart). Jobs requires pay-as-you-go credit.
19
 
20
- **See every recipe** β€” locally, no GPU or token:
 
 
 
 
21
 
22
  ```bash
23
- uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/list-recipes.py
24
  ```
25
 
26
- **Run one on a GPU** β€” extract text from [seven scanned NASA booklet pages](https://huggingface.co/datasets/uv-scripts/ocr-demo):
27
 
28
  ```bash
29
  hf jobs uv run --flavor a10g-small --timeout 15m --secrets HF_TOKEN \
@@ -31,48 +35,55 @@ hf jobs uv run --flavor a10g-small --timeout 15m --secrets HF_TOKEN \
31
  uv-scripts/ocr-demo your-username/ocr-demo-results
32
  ```
33
 
34
- Replace `your-username` with your Hugging Face username. The Job saves a new dataset with a `markdown` column. Follow the [OCR walkthrough](https://huggingface.co/datasets/uv-scripts/ocr#use-your-own-documents) to use your own scans or PDFs and retrieve and check the results.
35
 
36
- ## Drive it with your coding agent
37
 
38
- Recipes take their arguments in the same `input output` order and run from a URL, so an agent (Claude Code, Cursor, …) can pick one and run it with no setup. The simplest start β€” paste this so it discovers what's available:
39
 
40
  ```
41
- List the uv-scripts recipes and tell me which fit my task:
42
- uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/list-recipes.py
43
- For context on how these work, read the org page https://huggingface.co/uv-scripts
44
- and the GitHub repo https://github.com/davanstrien/uv-scripts-for-ai.
 
 
45
  ```
46
 
47
  <details>
48
- <summary><b>More prompts β€” run a job, build a dataset β†’</b></summary>
49
 
50
- **Try it now** β€” runs a real OCR job and hands back a dataset:
51
 
52
  ```
53
- Using uv-scripts, OCR a sample dataset on Hugging Face Jobs:
 
54
  hf jobs uv run --flavor a10g-small --timeout 15m --secrets HF_TOKEN \
55
  https://huggingface.co/datasets/uv-scripts/ocr/raw/main/glm-ocr.py \
56
- uv-scripts/ocr-demo $MY_HF_USERNAME/ocr-demo-results
57
  Then open the output dataset and show me the `markdown` column.
58
  ```
59
 
60
- **Put it to work** β€” when you need data for a task:
61
 
62
  ```
63
  I need a dataset for <my task>. uv-scripts has recipes that create, OCR,
64
- transcribe, classify, deduplicate, and embed datasets on Hugging Face. List them:
65
- uv run https://huggingface.co/datasets/uv-scripts/jobs-utils/raw/main/list-recipes.py
66
- Pick the one that fits, read its script header for the arguments, and run it with:
67
- hf jobs uv run --flavor l4x1 --secrets HF_TOKEN <script-url> INPUT_DATASET OUTPUT_DATASET
68
- Each recipe reads a Hub dataset and writes a new one, so chain them as needed.
69
- Background: https://huggingface.co/uv-scripts and https://github.com/davanstrien/uv-scripts-for-ai
70
  ```
71
 
72
- The cookbook also ships a ready-made **agent skill** for discovering and running recipes β€” see the [GitHub repo](https://github.com/davanstrien/uv-scripts-for-ai), and Hugging Face's own [`hf` CLI skill for agents](https://huggingface.co/docs/hub/agents-cli). _(We'll refine these prompts over time.)_
73
-
74
  </details>
75
 
 
 
 
 
 
 
76
  ## Browse
77
 
78
- Every recipe is in the list below β€” OCR, detection & segmentation, audio transcription, NER & classification, embeddings & atlas maps, batch LLM/VLM inference, synthetic data, and dataset creation. Or browse on **[GitHub](https://github.com/davanstrien/uv-scripts-for-ai)** Β· run `hf jobs hardware` for GPU flavors & pricing.
 
9
 
10
  # UV Scripts
11
 
12
+ **Run a data or ML task over a Hugging Face dataset in one command: OCR, transcription, classification, embeddings, deduplication and more.** Run it on your own machine, or on a pay-per-second GPU with [Hugging Face Jobs](https://huggingface.co/docs/hub/jobs-overview). For people and coding agents.
13
 
14
+ Each recipe is one Python file with its dependencies declared inside it ([UV script](https://docs.astral.sh/uv/guides/scripts/)), so it runs straight from its URL: no clone, no virtualenv, no `pip install`. Most recipes read a Hub dataset and write a new one, so one recipe's output can be the next one's input.
15
 
16
  ## Quickstart
17
 
18
+ First [install the `hf` CLI](https://huggingface.co/docs/huggingface_hub/en/guides/cli#getting-started). **See the recipe families** (no GPU, no account):
19
 
20
+ ```bash
21
+ hf datasets ls --author uv-scripts
22
+ ```
23
+
24
+ List a family's scripts without downloading them:
25
 
26
  ```bash
27
+ hf download uv-scripts/ocr --repo-type dataset --include "*.py" --dry-run
28
  ```
29
 
30
+ **OCR seven scanned pages on a GPU** from a [NASA booklet](https://huggingface.co/datasets/uv-scripts/ocr-demo). [Sign in](https://huggingface.co/docs/hub/jobs-quickstart) with a token that can write to your account; Jobs needs [pre-paid credits](https://huggingface.co/settings/billing). Replace `your-username` with your Hugging Face username (`hf auth whoami` shows it):
31
 
32
  ```bash
33
  hf jobs uv run --flavor a10g-small --timeout 15m --secrets HF_TOKEN \
 
35
  uv-scripts/ocr-demo your-username/ocr-demo-results
36
  ```
37
 
38
+ This takes about 4 minutes on an `a10g-small` ($1.00/hour), so about $0.07. Most of that is startup. The Job saves a new dataset with a `markdown` column. Follow the [OCR walkthrough](https://huggingface.co/datasets/uv-scripts/ocr#use-your-own-documents) to use your own scans or PDFs and to check the results.
39
 
40
+ ## Use it with your coding agent
41
 
42
+ A recipe runs from a URL and documents itself in its header, so a coding agent (Claude Code, Codex, Cursor, …) can pick one and run it with no setup. Paste this to start:
43
 
44
  ```
45
+ List the uv-scripts recipe families and tell me which fit my task:
46
+ hf datasets ls --author uv-scripts
47
+ List a family's scripts with:
48
+ hf download uv-scripts/<family> --repo-type dataset --include "*.py" --dry-run
49
+ Read the matching family's README on the Hub. Before running a script, read its header and docstring for the arguments and hardware.
50
+ Use my username from `hf auth whoami` for output datasets, and always set --timeout.
51
  ```
52
 
53
  <details>
54
+ <summary><b>More prompts: run a job, build a dataset</b></summary>
55
 
56
+ **Try it now.** Runs a real OCR Job and hands back a dataset:
57
 
58
  ```
59
+ Using uv-scripts, OCR a sample dataset on Hugging Face Jobs. Find my username
60
+ with `hf auth whoami`, then run:
61
  hf jobs uv run --flavor a10g-small --timeout 15m --secrets HF_TOKEN \
62
  https://huggingface.co/datasets/uv-scripts/ocr/raw/main/glm-ocr.py \
63
+ uv-scripts/ocr-demo <my-username>/ocr-demo-results
64
  Then open the output dataset and show me the `markdown` column.
65
  ```
66
 
67
+ **Put it to work.** When you need data for a task:
68
 
69
  ```
70
  I need a dataset for <my task>. uv-scripts has recipes that create, OCR,
71
+ transcribe, classify, deduplicate and embed datasets on Hugging Face. List them:
72
+ hf datasets ls --author uv-scripts
73
+ Pick the family that fits, read its README, then read the script's header and docstring: arguments, input and
74
+ output types, and the hardware it needs. Start with a small sample if the recipe
75
+ has a --max-samples option, choose a --flavor and an explicit --timeout, and run
76
+ it with `hf jobs uv run`. Check each step's output before chaining the next.
77
  ```
78
 
 
 
79
  </details>
80
 
81
+ To teach your agent the rest of the `hf` CLI, install Hugging Face's [`hf` CLI skill](https://huggingface.co/docs/hub/agents-cli) with `hf skills add`.
82
+
83
+ ## Built with uv-scripts
84
+
85
+ Most recipes tag the dataset card they push with `uv-script`, and many add a *Reproduction* section with the exact command. [386 datasets carry the tag](https://huggingface.co/datasets?other=uv-script) (October 2026), from more than 40 accounts besides this org and its maintainer. Built something? Keep the tag so others can find it, and share the link.
86
+
87
  ## Browse
88
 
89
+ Every recipe is in the list below: OCR, detection and segmentation, audio transcription, NER and classification, embeddings and atlas maps, batch LLM/VLM inference, synthetic data and dataset creation. Or browse on **[GitHub](https://github.com/davanstrien/uv-scripts-for-ai)**. Run `hf jobs hardware` for GPU flavors and prices.