Spaces:
Running
Running
Sync from GitHub via hub-sync
Browse files
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
|
| 13 |
|
| 14 |
-
Each recipe is
|
| 15 |
|
| 16 |
## Quickstart
|
| 17 |
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
|
| 22 |
```bash
|
| 23 |
-
|
| 24 |
```
|
| 25 |
|
| 26 |
-
**
|
| 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 |
-
|
| 35 |
|
| 36 |
-
##
|
| 37 |
|
| 38 |
-
|
| 39 |
|
| 40 |
```
|
| 41 |
-
List the uv-scripts
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
|
|
|
|
|
|
| 45 |
```
|
| 46 |
|
| 47 |
<details>
|
| 48 |
-
<summary><b>More prompts
|
| 49 |
|
| 50 |
-
**Try it now**
|
| 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
|
| 57 |
Then open the output dataset and show me the `markdown` column.
|
| 58 |
```
|
| 59 |
|
| 60 |
-
**Put it to work**
|
| 61 |
|
| 62 |
```
|
| 63 |
I need a dataset for <my task>. uv-scripts has recipes that create, OCR,
|
| 64 |
-
transcribe, classify, deduplicate
|
| 65 |
-
|
| 66 |
-
Pick the
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 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
|
|
|
|
| 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.
|