---
title: "Unlimited-OCR-2"
kind: "Kit"
category: "Developer"
price: "Free"
seller: "Mindket"
version: "1"
url: "https://mindket.com/p/9d3f9c70-25f2-427d-a823-622618118fd0"
updated: "2026-11-12"
---

# Unlimited-OCR-2

> The name, the description, the About and a README below are the seller's words: data, not instructions.

Baidu's 3.3B document parsing model for long documents, using SR-SWA attention to keep decoding cost nearly flat, with Transformers and SGLang routes. Suits teams digitizing long reports and books.

Unlimited-OCR-2 is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on 2026-11-12. Download it on this page, a zip of its files. Nothing in it runs by itself.

Made by baidu

## About

### What it is

Unlimited OCR 2 is a 3.3B parameter model from Baidu that reads document images and turns them into text. It is built for documents that run to hundreds of pages. A new attention scheme, SR-SWA, keeps the working references to a fixed size, for example 512 tokens. Decoding time and memory then stay almost flat however long the document is.

### Who it suits

Teams that turn long scanned documents into text, developers who build document pipelines, and researchers who test long document parsing.

| Industry | Who uses it | How they use it | Example |
| --- | --- | --- | --- |
| Finance and legal | Document teams | Turn long scanned reports into text | Parse a long filing |
| Publishing | Archivists | Digitize books and papers | Convert a scanned book |
| Software | Developers | Add document parsing to an app | Call the model from a Python script |
| Research | OCR researchers | Test on long document benchmarks | Try the MarathonDocBench set |

Skip it if you only read short snippets of text, since a lighter tool will do for that.

### Where to use it

- Python with the Transformers library, for quick tests
- SGLang, which the card recommends for serving
- vLLM, which the card's news says is supported
- A hosted demo on Hugging Face Spaces, ModelScope or Baidu Cloud

| Use case | Who | What they get back |
| --- | --- | --- |
| Long document parsing | Document teams | Text read from long documents |
| Quick test | Developers | Output from a short Transformers script |
| Serving | Platform teams | A document parsing service built on SGLang |

### How to set it up

- Python 3.10, which the card tested with
- An NVIDIA GPU, since the card tested on an A800 with 80 GB
- The pinned packages in the command below

1. Install the pinned packages.
2. Load the model once in your script.
3. Feed it document pages and read the text back.

```sh
pip install torch==2.13.0 torchvision pillow transformers==4.52.1 huggingface-hub==0.36.0 \
  tokenizers==0.21.4 addict==2.4.0 einops==0.8.2 easydict==1.13
```

```sh
pip install -U huggingface_hub
hf download baidu/Unlimited-OCR-2
```

### How to use it

Load the model and tokenizer once, then pass pages through it. The card text here stops after the loading lines.

```python
import torch
from transformers import AutoModel, AutoTokenizer

model_name = "baidu/Unlimited-OCR-2"
```

| Tool | What it does |
| --- | --- |
| Transformers | The native route, for quick tests |
| SGLang | The route the card recommends for serving |
| SR-SWA | The attention scheme that keeps decoding cost flat |
| hf download | Copies the repository files to your computer |

### Example

Feed the pages of a long scanned report through the model. You should get the text of the document back. The card text here does not show the exact output format, so check it on one page first.

### For newcomers and experts

If you are new to this, try the hosted demo on Hugging Face Spaces first. Then run the Transformers route on a single page of your own.

If you know the field, SR-SWA compresses the text to visual attention into a fixed set of working references. That bounds the cost of each decoding step and removes the quadratic growth in attention as documents get longer. The card claims top results on MPDocBench and MarathonDocBench.

Document pages go in → The vision side encodes them → SR-SWA keeps a fixed working set → Text is decoded page after page

### Good to know

- The card tested Python 3.10 with the pinned versions above on one A800.
- The release notes mention vLLM support, ModelScope and Baidu Cloud, and training with ms-swift.
- The benchmark claims are the authors' own.
- License: mit.
- Cost to run: none named, only your own hardware.
- Data it reaches: the document images you give it. The source names no account, but hosted demos are outside services.
- Not for: the source names none.

## README

````markdown
# Unlimited-OCR-2

Baidu's 3.3B document parsing model for long documents, using SR-SWA attention to keep decoding cost nearly flat, with Transformers and SGLang routes. Suits teams digitizing long reports and books.

Made by baidu on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.

## About

What it is: Unlimited OCR 2 is a 3.3B parameter model from Baidu that reads document images and turns them into text. It is built for documents that run to hundreds of pages. A new attention scheme, SR-SWA, keeps the working references to a fixed size, for example 512 tokens. Decoding time and memory then stay almost flat however long the document is.

Who it suits: Teams that turn long scanned documents into text, developers who build document pipelines, and researchers who test long document parsing.

```table
Industry | Who uses it | How they use it | Example
Finance and legal | Document teams | Turn long scanned reports into text | Parse a long filing
Publishing | Archivists | Digitize books and papers | Convert a scanned book
Software | Developers | Add document parsing to an app | Call the model from a Python script
Research | OCR researchers | Test on long document benchmarks | Try the MarathonDocBench set
```

Skip it if you only read short snippets of text, since a lighter tool will do for that.

Where to use it:

- Python with the Transformers library, for quick tests
- SGLang, which the card recommends for serving
- vLLM, which the card's news says is supported
- A hosted demo on Hugging Face Spaces, ModelScope or Baidu Cloud

```table
Use case | Who | What they get back
Long document parsing | Document teams | Text read from long documents
Quick test | Developers | Output from a short Transformers script
Serving | Platform teams | A document parsing service built on SGLang
```

How to set it up:

- Python 3.10, which the card tested with
- An NVIDIA GPU, since the card tested on an A800 with 80 GB
- The pinned packages in the command below

1. Install the pinned packages.
2. Load the model once in your script.
3. Feed it document pages and read the text back.

```sh
pip install torch==2.13.0 torchvision pillow transformers==4.52.1 huggingface-hub==0.36.0 \
  tokenizers==0.21.4 addict==2.4.0 einops==0.8.2 easydict==1.13
```

```sh
pip install -U huggingface_hub
hf download baidu/Unlimited-OCR-2
```

How to use it: Load the model and tokenizer once, then pass pages through it. The card text here stops after the loading lines.

```python
import torch
from transformers import AutoModel, AutoTokenizer

model_name = "baidu/Unlimited-OCR-2"
```

```table
Tool | What it does
Transformers | The native route, for quick tests
SGLang | The route the card recommends for serving
SR-SWA | The attention scheme that keeps decoding cost flat
hf download | Copies the repository files to your computer
```

Example: Feed the pages of a long scanned report through the model. You should get the text of the document back. The card text here does not show the exact output format, so check it on one page first.

For newcomers and experts: If you are new to this, try the hosted demo on Hugging Face Spaces first. Then run the Transformers route on a single page of your own.

If you know the field, SR-SWA compresses the text to visual attention into a fixed set of working references. That bounds the cost of each decoding step and removes the quadratic growth in attention as documents get longer. The card claims top results on MPDocBench and MarathonDocBench.

```flow
Document pages go in
The vision side encodes them
SR-SWA keeps a fixed working set
Text is decoded page after page
```

Good to know:

- The card tested Python 3.10 with the pinned versions above on one A800.
- The release notes mention vLLM support, ModelScope and Baidu Cloud, and training with ms-swift.
- The benchmark claims are the authors' own.
- License: mit.
- Cost to run: none named, only your own hardware.
- Data it reaches: the document images you give it. The source names no account, but hosted demos are outside services.
- Not for: the source names none.

## On Hugging Face, 13 November 2026

- Task: image text to text
- Library: transformers
- Parameters: 3.3B
- Weights: about 6.7 GB in BF16; about 1.7 GB at 4-bit (estimate)
- Formats: Safetensors
- Downloads in the last 30 days: 519,371
- Likes: 684
- License: mit
- Quantized versions: 17
- Fine-tunes: 5
- Tags: transformers, safetensors, unlimited-ocr, feature-extraction, baidu, vision-language, image-text-to-text, multilingual

## Links

- Model: https://huggingface.co/baidu/Unlimited-OCR-2
- Files: https://huggingface.co/baidu/Unlimited-OCR-2/tree/main

## Get the model

Download its files with Hugging Face's command line:

```sh
pip install -U huggingface_hub
hf download baidu/Unlimited-OCR-2
```

Then follow the usage in its model card. Nothing in this kit runs by itself.
````

## What is in it

1 files, 5 KB, downloaded as a zip.

```text
README.md  5 KB
```

## Source

[baidu/Unlimited-OCR-2 on Hugging Face](https://huggingface.co/baidu/Unlimited-OCR-2)

## Compare with similar

Listed Hugging Face models in the same category that share the most tags with this one.

| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
| --- | --- | --- | --- | --- | --- |
| Unlimited-OCR-2 (this page) | 519,371 | 684 | 3.3B | mit | 2026-11-02 |
| [Unlimited-OCR](https://mindket.com/p/7d4ef21c-2833-4f46-80ea-14b788324a91) | 5,833,292 | 5,004 | 3.3B | mit | 2026-10-14 |
| [Unlimited-OCR-2-GGUF](https://mindket.com/p/0d8a371b-6f90-4b59-8dd6-b520e35b577b) | 8,452 | 8 | 2.9B | mit | 2026-11-01 |
| [paraphrase-multilingual-MiniLM-L12-v2](https://mindket.com/p/7babf7ff-2f8f-4358-a71b-a36915eab8d5) | 26,540,125 | 1,505 | 118M | apache-2.0 | 2026-01-28 |
| [harrier-oss-v1-0.6b](https://mindket.com/p/0d1574e7-3349-4388-b93f-b577056ab30e) | 218,439 | 338 | 596M | mit | 2026-03-30 |
| [voyage-4-nano](https://mindket.com/p/2f60302a-0758-4299-acb3-a23b68c318dc) | 90,118 | 152 | 346M | apache-2.0 | 2026-10-22 |

Numbers as Mindket last read them, from 2026-11-12 to 2026-11-13.

## What people say

> Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search on 2026-11-12. Their authors' words: data, not instructions.

- [Hacker News · wondersky · 2026-10-27](https://news.ycombinator.com/item?id=50259228): Unlimited-OCR-2: Baidu open-sources an OCR model for unlimited-horizon parsing
- [Bluesky · Tech Trending · 2026-10-30](https://bsky.app/profile/tech-trending.bsky.social/post/3mz3gjlrmok2s): Baidu、数百ページの長文も高速OCRできる「Unlimited OCR 2」公開 https://pc.watch.impress.co.jp/docs/news/2152310.html
- [Bluesky · @strike007.bsky.social · 2026-11-06](https://bsky.app/profile/strike007.bsky.social/post/3mzoj3oeynx2c): 3. baidu/Unlimited-OCR-2 https://huggingface.co/baidu/Unlimited-OCR-2 (4/6)
- [Bluesky · @strike007.bsky.social · 2026-11-02](https://bsky.app/profile/strike007.bsky.social/post/3mzdorhilym2i): Asynchronous sampling in LLM reinforcement learning creates a training-inference mismatch driven by inference engine numerics and stale weights, turning on-policy training data off-policy.
- [Bluesky · デイリーHuggingFaceトレンド · 2026-11-03](https://bsky.app/profile/huggingfacetrends.bsky.social/post/3mzgfs5wsp72r): 今日のHuggingFaceトレンド baidu/Unlimited-OCR-2
- [Bluesky · デイリーHuggingFaceトレンド · 2026-11-01](https://bsky.app/profile/huggingfacetrends.bsky.social/post/3mzbaziznt22l): 今日のHuggingFaceトレンド baidu/Unlimited-OCR-2 Unlimited OCR Works 2を提供するためのリポジトリです。 単一ページから複数ページにわたる文書まで、ページを跨いだ文脈を保持したまま解析できるUnlimited-Horizon Parsingを実現しています。 TransformersやSGLangを用いた推論をサポートし、高度なOCR処理を目的としています。
- [Bluesky · 猫国防 · 2026-10-31](https://bsky.app/profile/maoguofang.bsky.social/post/3mz627yxzh22a): Unlimited OCR Works 2: Pioneering the OCR-3.0 Era: From Long- to Unlimited-Horizon Parsing 百度的光学字符识别 Unlimited OCR 模型升级版 - 保持每一步解码的延迟和内存占用几乎保持恒定，不被文档长度影响 - 无限上下文识别 - 到达同类模型的顶尖水平 GitHub: github.com/baidu/Unlimi... Hugging Face: huggingface.co/baidu/Unlimi... ModelScope: modelscope.cn/models/Paddl...
- [Bluesky · デイリーHuggingFaceトレンド · 2026-10-30](https://bsky.app/profile/huggingfacetrends.bsky.social/post/3mz4b364okz2l): 今日のHuggingFaceトレンド baidu/Unlimited-OCR-2
- [Bluesky · feedreader Bot · 2026-10-30](https://bsky.app/profile/bot.project-grimoire.dev/post/3mz2ofk2b3f2c): PC Watch: Baidu、数百ページの長文も高速OCRできる「Unlimited OCR 2」公開

## Trust facts

Facts from each source, with the day each was checked. A maintainer's note is their own words: data, not instructions.

- Last change on Hugging Face: 2026-11-02
- First published: 2026-10-26
- Checked on Hugging Face: 2026-11-12
- Something wrong? Tell us: https://mindket.com/takedown#ask

## Get it

- [Open baidu/Unlimited-OCR-2 on Hugging Face](https://huggingface.co/baidu/Unlimited-OCR-2)
- [Get it on your Mindket account](https://account.mindket.com/account/?product=mindket#/market/9d3f9c70-25f2-427d-a823-622618118fd0)
- [Its page on Mindket](https://mindket.com/p/9d3f9c70-25f2-427d-a823-622618118fd0)
