Add Qianfan-OCR to README (15 models)
Browse files6 unmodified lines789101011121334 unmodified lines48495051525354368 unmodified lines4234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764776 unmodified lines
> Part of [uv-scripts](https://huggingface.co/uv-scripts) - ready-to-run ML tools powered by UV and HuggingFace Jobs.
14 OCR models from 0.9B to 8B parameters. Pick a model, point at your dataset, get markdown — no setup required.15 OCR models from 0.9B to 8B parameters. Pick a model, point at your dataset, get markdown — no setup required.
## 🚀 Quick Start
34 unmodified lines| `deepseek-ocr-vllm.py` | [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) | 4B | vLLM | 5 resolution + 5 prompt modes || `deepseek-ocr.py` | [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) | 4B | Transformers | Same model, Transformers backend || `deepseek-ocr2-vllm.py` | [DeepSeek-OCR-2](https://huggingface.co/deepseek-ai/DeepSeek-OCR-2) | 3B | vLLM | Newer, requires nightly vLLM || `qianfan-ocr.py` | [Qianfan-OCR](https://huggingface.co/baidu/Qianfan-OCR) | 4.7B | vLLM | #1 OmniDocBench v1.5 (93.12), Layout-as-Thought, 192 languages || `olmocr2-vllm.py` | [olmOCR-2-7B](https://huggingface.co/allenai/olmOCR-2-7B-1025-FP8) | 7B | vLLM | 82.4% olmOCR-Bench || `rolm-ocr.py` | [RolmOCR](https://huggingface.co/reducto/RolmOCR) | 7B | vLLM | Qwen2.5-VL based, general-purpose || `numarkdown-ocr.py` | [NuMarkdown-8B](https://huggingface.co/numind/NuMarkdown-8B-Thinking) | 8B | vLLM | Reasoning-based OCR |368 unmodified lines --max-samples 100```
### Qianfan-OCR (`qianfan-ocr.py`) — #1 on OmniDocBench v1.5
End-to-end document intelligence using [baidu/Qianfan-OCR](https://huggingface.co/baidu/Qianfan-OCR) with 4.7B parameters:
- **93.12 on OmniDocBench v1.5** — #1 end-to-end model- **79.8 on OlmOCR Bench** — #1 end-to-end model- 🧠 **Layout-as-Thought** — Optional reasoning phase for complex layouts (`--think`)- 🌍 **192 languages** — Latin, CJK, Arabic, Cyrillic, and more- 📝 **OCR mode** — Document parsing to markdown (default)- 📊 **Table mode** — HTML table extraction- 📐 **Formula mode** — LaTeX recognition- 📈 **Chart mode** — Chart understanding and analysis- 🔍 **Scene mode** — Scene text extraction- 🔑 **KIE mode** — Key information extraction with custom prompts
**Prompt Modes:**
- `ocr`: Document parsing to markdown (default)- `table`: Table extraction to HTML- `formula`: Formula recognition to LaTeX- `chart`: Chart understanding- `scene`: Scene text extraction- `kie`: Key information extraction (requires `--custom-prompt`)
**Quick start:**
```bash# Basic OCRhf jobs uv run --flavor l4x1 \ -s HF_TOKEN \ https://huggingface.co/datasets/uv-scripts/ocr/raw/main/qianfan-ocr.py \ your-input-dataset your-output-dataset \ --max-samples 100
# Layout-as-Thought for complex documentshf jobs uv run --flavor l4x1 \ -s HF_TOKEN \ https://huggingface.co/datasets/uv-scripts/ocr/raw/main/qianfan-ocr.py \ your-input-dataset your-output-dataset \ --think --max-samples 50
# Key information extractionhf jobs uv run --flavor l4x1 \ -s HF_TOKEN \ https://huggingface.co/datasets/uv-scripts/ocr/raw/main/qianfan-ocr.py \ invoices extracted-fields \ --prompt-mode kie --custom-prompt "Extract: name, date, total. Output as JSON."```
### olmOCR2 (`olmocr2-vllm.py`)
High-quality document OCR using [allenai/olmOCR-2-7B-1025-FP8](https://huggingface.co/allenai/olmOCR-2-7B-1025-FP8) optimized with GRPO reinforcement learning:README.md+51-1