Spaces:
Running
title: README
emoji: π
colorFrom: red
colorTo: indigo
sdk: static
pinned: false
UV Scripts
Ready-to-run ML tools powered by UV - zero setup, maximum power
Run state-of-the-art ML workflows with a single command. From OCR to classification, all scripts work instantly with uv run
.
What are UV scripts?
UV scripts are self-contained Python scripts that use inline metadata to specify dependencies. Just uv run script.py
and everything installs automatically.
Perfect for:
- π GPU workflows on HF Jobs
- π» Local processing on your machine
- π Reproducible pipelines that work anywhere
π Quick Example
# Extract text from images with state-of-the-art OCR
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \
your-image-dataset \
your-extracted-text
# Or run on GPU with HF Jobs (no local GPU needed!)
hf jobs uv run --flavor l4x1 \
https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \
your-images your-text
π Browse Scripts
Script Collection | Description | GPU Required |
---|---|---|
ocr | Extract text from images with VLMs (LaTeX, tables, forms) | β |
classification | Text classification with guaranteed valid outputs | β |
dataset-creation | Create datasets from PDFs and files | β |
vllm | High-performance inference with vLLM | β |
π― Why UV Scripts?
Zero Setup
No virtual environments, no dependency conflicts, no installation steps. UV handles everything automatically when you run the script.
Production Ready
These aren't demos - they're production-quality tools used by the community for real ML workflows.
GPU Optimized
Seamlessly run on local GPUs or scale to cloud with HF Jobs. Same script, different compute.
Community Driven
Browse scripts, contribute your own, and learn from the best practices of the ML community.
π Featured Scripts
OCR Any Document Dataset
Extract text from images with state-of-the-art accuracy:
# Handles LaTeX, tables, forms, handwriting
uv run https://huggingface.co/datasets/uv-scripts/ocr/raw/main/nanonets-ocr.py \
your-images extracted-text
Classify with Guaranteed Valid Outputs
Text classification that always returns valid labels:
# Uses vLLM's structured generation - no invalid outputs!
uv run https://huggingface.co/datasets/uv-scripts/classification/raw/main/classify-dataset.py \
--input-dataset imdb --column text \
--labels "positive,negative" --output-dataset imdb-classified
π Getting Started
Install UV (one-time setup):
curl -LsSf https://astral.sh/uv/install.sh | sh
Run any script:
uv run https://huggingface.co/datasets/uv-scripts/[collection]/raw/main/[script].py
Or use HF Jobs (no local GPU needed):
hf jobs uv run --flavor l4x1 [script-url] [args]
π€ Contributing
We welcome scripts that:
- Solve real ML problems
- Include clear documentation
- Follow UV best practices
- Work on both local and cloud
Submit your scripts as PRs to the relevant collection or propose a new collection!
π Learn More
UV Scripts is a community project showcasing the power of UV for ML workflows.