Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/workflows/check-run-on-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Check run-on-jobs catalogue
# Fails when a recipe changes without rebuilding the Space, or when a declared model leaves the Hub.
on:
pull_request:
schedule:
- cron: '0 7 * * 1'
workflow_dispatch:

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Space files match the recipes, and declared models exist
run: python3 tools/build-catalog.py --check --verify-models
15 changes: 15 additions & 0 deletions .github/workflows/sync-run-on-jobs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Sync run-on-jobs → HF
on:
push:
branches: [main]
paths: ['run-on-jobs/**', '.github/workflows/sync-run-on-jobs.yml']

jobs:
sync:
uses: ./.github/workflows/_sync-folder.yml
with:
folder: run-on-jobs
repo_id: uv-scripts/run-on-jobs
repo_type: space
secrets:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
37 changes: 37 additions & 0 deletions run-on-jobs/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Run a model on Hugging Face Jobs

Each recipe is one script, run from its URL with `hf jobs uv run`. There is nothing to clone or install except the `hf` CLI.

## Set up

- Check `hf version` (needs 1.32+). If it's missing: `curl -LsSf https://hf.co/cli/install.sh | bash`, then `hf auth login`.
- Jobs need pay-as-you-go credit, and each job costs money. Confirm with the user before starting one.
- The CLI is the current reference: `hf --help`, `hf jobs uv run --help`, `hf jobs hardware`. To install the Hugging Face CLI skill, run `hf skills add`.

## Find a recipe

- `hf download uv-scripts/run-on-jobs recipes.json --repo-type space`, then look for the model in `recipes[].models`.
- `kind`: `run` applies a model to data; `train` fine-tunes one.
- `source`: `header` carries its launch settings; `documented` is an example from the script's docs; `flags-needed` has no command, so read the script first.
- Read a script's docstring and options: `curl -s <url> | head -100`. Running it locally may fail on GPU-only dependencies.
- Each task's README explains its recipes, for example https://huggingface.co/datasets/uv-scripts/ocr. OCR also has `models.json`, with language coverage and support levels.
- Fuller guides: [uv-recipes](https://github.com/davanstrien/uv-scripts/tree/main/skills/uv-recipes) and, for few-shot fine-tuning, [setfit-on-jobs](https://github.com/davanstrien/uv-scripts/tree/main/skills/setfit-on-jobs).

## Run it

Start from the recipe's `command` field. Most recipes go from dataset to dataset:

hf jobs uv run <url> <input-dataset> <output-dataset> --max-samples 10

Recipes that read files use mounts. A local folder also works as a source:

hf jobs uv run -v hf://buckets/<user>/<input>:/input:ro -v hf://buckets/<user>/<output>:/output <url> /input /output

- Preview for free with `--dry-run`, and check the flavor: without a header, a GPU recipe can resolve to `cpu-basic`.
- Flags before the URL configure the job and override the header, such as `--flavor` and `--timeout`. Flags after it go to the script. If a script flag has the same name as a job flag, put `--` before the URL.
- Start with a small `--max-samples` if the script has it, and add `--private` if the output shouldn't be public.

## Check it

- Use `--detach` for long runs, then `hf jobs logs -f <id>`, `hf jobs wait <id>` or `hf jobs inspect <id>`. `hf jobs cancel <id>` stops one.
- Look at the output rows. A completed job doesn't prove they're correct.
42 changes: 42 additions & 0 deletions run-on-jobs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
title: Run on Jobs
emoji: ⚡
colorFrom: blue
colorTo: gray
sdk: static
pinned: false
short_description: Batch-run this model on your own data with HF Jobs
models:
- allenai/olmOCR-2-7B-1025-FP8
- ATH-MaaS/OvisOCR2
- baidu/Qianfan-OCR
- baidu/Unlimited-OCR
- baidu/Unlimited-OCR-2
- datalab-to/lift
- datalab-to/surya-ocr-2
- deepseek-ai/DeepSeek-OCR
- deepseek-ai/DeepSeek-OCR-2
- facebook/sam3
- fastino/gliner2.5-multi-v1
- HuggingFaceTB/SmolLM3-3B
- lightonai/LightOnOCR-2-1B
- lightonai/LightOnOCR-3-4B
- NemoStation/Marlin-2B
- numind/NuExtract3
- nvidia/NVIDIA-Nemotron-3.5-Transcribe-30B-A4B
- PaddlePaddle/PaddleOCR-VL-1.6
- Qwen/Qwen2-VL-7B-Instruct
- Qwen/Qwen3.6-35B-A3B
- Qwen/Qwen3.8-27B
- rednote-hilab/dots.mocr
- rednote-hilab/dots.ocr
- sentence-transformers/all-MiniLM-L6-v2
- tencent/HunyuanOCR
- zai-org/GLM-OCR
---

# Run on Jobs

A catalogue of [uv-scripts](https://huggingface.co/uv-scripts) recipes: one command runs a model over your own data on [Hugging Face Jobs](https://huggingface.co/docs/hub/jobs).

This Space is generated from [davanstrien/uv-scripts](https://github.com/davanstrien/uv-scripts). To change it, edit the recipes or `tools/build-catalog.py` there. Agents should read [AGENTS.md](./AGENTS.md).
Binary file added run-on-jobs/assets/nasa-food-list.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading