Image-Text-to-Text
Transformers
Safetensors
qwen3_5
ocr
document-parsing
document-understanding
visual-question-answering
key-information-extraction
vision-language-model
multimodal
xiaomi
seerray
conversational
Eval Results
Instructions to use xiaomi-research/Xiaomi-OCR-0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use xiaomi-research/Xiaomi-OCR-0 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="xiaomi-research/Xiaomi-OCR-0") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("xiaomi-research/Xiaomi-OCR-0") model = AutoModelForMultimodalLM.from_pretrained("xiaomi-research/Xiaomi-OCR-0", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use xiaomi-research/Xiaomi-OCR-0 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "xiaomi-research/Xiaomi-OCR-0" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaomi-research/Xiaomi-OCR-0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/xiaomi-research/Xiaomi-OCR-0
- SGLang
How to use xiaomi-research/Xiaomi-OCR-0 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "xiaomi-research/Xiaomi-OCR-0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaomi-research/Xiaomi-OCR-0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "xiaomi-research/Xiaomi-OCR-0" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "xiaomi-research/Xiaomi-OCR-0", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use xiaomi-research/Xiaomi-OCR-0 with Docker Model Runner:
docker model run hf.co/xiaomi-research/Xiaomi-OCR-0
Upload folder using huggingface_hub
Browse files- README.md +31 -23
- README_zh.md +16 -12
README.md
CHANGED
|
@@ -4,23 +4,28 @@ base_model: Qwen/Qwen3.5-0.8B-Base
|
|
| 4 |
library_name: transformers
|
| 5 |
pipeline_tag: image-text-to-text
|
| 6 |
tags:
|
| 7 |
-
- ocr
|
| 8 |
-
- document-parsing
|
| 9 |
-
- document-understanding
|
| 10 |
-
-
|
| 11 |
-
-
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
-
|
| 15 |
-
-
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
---
|
| 18 |
|
| 19 |
<div align="center" style="text-align:center">
|
| 20 |
<h1>Xiaomi-OCR-0</h1>
|
| 21 |
<p><b>A unified 0.8B model for document parsing and OCR-related understanding.</b></p>
|
| 22 |
<p><b>English</b> · <a href="https://huggingface.co/SeerRay-Lab/Xiaomi-OCR-0/blob/main/README_zh.md">简体中文</a></p>
|
| 23 |
-
<p><a href="https://huggingface.co/spaces/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/Project-Page-FF6900?logo=huggingface&logoColor=FFD21E" alt="Project Page"></a> <a href="https://github.com/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/GitHub-SeerRay--Lab%2FXiaomi--OCR--0-181717?logo=github" alt="GitHub"></a></p>
|
| 24 |
</div>
|
| 25 |
|
| 26 |
Xiaomi-OCR-0 is a unified 0.8B OCR-specialized vision-language model for both **document parsing** and **OCR-centric understanding**.
|
|
@@ -144,7 +149,7 @@ Scaling from 0.8B to 4B brings a clearly larger gain on understanding (about **4
|
|
| 144 |
|
| 145 |

|
| 146 |
|
| 147 |
-
For more detail, including the full analysis behind these findings, see the technical report
|
| 148 |
|
| 149 |
## 🚀 Usage
|
| 150 |
|
|
@@ -205,16 +210,6 @@ new_tokens = output[:, inputs["input_ids"].shape[1]:]
|
|
| 205 |
print(processor.batch_decode(new_tokens, skip_special_tokens=True)[0])
|
| 206 |
```
|
| 207 |
|
| 208 |
-
## Try it with an agent
|
| 209 |
-
|
| 210 |
-
> ⚠️ **Notice:** With your authorization, this Skill may create a Python environment, install dependencies, download model weights, install and configure SGLang or vLLM, and register an MCP server. Model and layout downloads can be large. If you do not agree to this setup flow, do not execute the command below.
|
| 211 |
-
|
| 212 |
-
```text
|
| 213 |
-
Read and execute https://raw.githubusercontent.com/SeerRay-Lab/Xiaomi-OCR-0/main/SKILL.md
|
| 214 |
-
```
|
| 215 |
-
|
| 216 |
-
The model runs on your machine.
|
| 217 |
-
|
| 218 |
### Task prompts
|
| 219 |
|
| 220 |
| Task | Prompt | Output |
|
|
@@ -408,4 +403,17 @@ Xiaomi-OCR-0 builds on the open OCR and multimodal LLM community. We thank every
|
|
| 408 |
## Citation and License
|
| 409 |
|
| 410 |
- **License:** Apache-2.0.
|
| 411 |
-
- **Paper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
library_name: transformers
|
| 5 |
pipeline_tag: image-text-to-text
|
| 6 |
tags:
|
| 7 |
+
- ocr
|
| 8 |
+
- document-parsing
|
| 9 |
+
- document-understanding
|
| 10 |
+
- visual-question-answering
|
| 11 |
+
- key-information-extraction
|
| 12 |
+
- vision-language-model
|
| 13 |
+
- multimodal
|
| 14 |
+
- xiaomi
|
| 15 |
+
- seerray
|
| 16 |
+
datasets:
|
| 17 |
+
- custom-ocr-centric-corpus
|
| 18 |
+
metrics:
|
| 19 |
+
- accuracy
|
| 20 |
+
- teds
|
| 21 |
+
- cdm
|
| 22 |
---
|
| 23 |
|
| 24 |
<div align="center" style="text-align:center">
|
| 25 |
<h1>Xiaomi-OCR-0</h1>
|
| 26 |
<p><b>A unified 0.8B model for document parsing and OCR-related understanding.</b></p>
|
| 27 |
<p><b>English</b> · <a href="https://huggingface.co/SeerRay-Lab/Xiaomi-OCR-0/blob/main/README_zh.md">简体中文</a></p>
|
| 28 |
+
<p><a href="https://huggingface.co/spaces/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/Project-Page-FF6900?logo=huggingface&logoColor=FFD21E" alt="Project Page"></a> <a href="https://github.com/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/GitHub-SeerRay--Lab%2FXiaomi--OCR--0-181717?logo=github" alt="GitHub"></a> <a href="https://arxiv.org/abs/2609.36136"><img src="https://img.shields.io/badge/arXiv-2609.36136-B31B1B?logo=arxiv" alt="arXiv"></a></p>
|
| 29 |
</div>
|
| 30 |
|
| 31 |
Xiaomi-OCR-0 is a unified 0.8B OCR-specialized vision-language model for both **document parsing** and **OCR-centric understanding**.
|
|
|
|
| 149 |
|
| 150 |

|
| 151 |
|
| 152 |
+
For more detail, including the full analysis behind these findings, see the [technical report](https://arxiv.org/abs/2609.36136).
|
| 153 |
|
| 154 |
## 🚀 Usage
|
| 155 |
|
|
|
|
| 210 |
print(processor.batch_decode(new_tokens, skip_special_tokens=True)[0])
|
| 211 |
```
|
| 212 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
### Task prompts
|
| 214 |
|
| 215 |
| Task | Prompt | Output |
|
|
|
|
| 403 |
## Citation and License
|
| 404 |
|
| 405 |
- **License:** Apache-2.0.
|
| 406 |
+
- **Paper:** [Xiaomi-OCR-0 Technical Report](https://arxiv.org/abs/2609.36136) (arXiv:2609.36136)
|
| 407 |
+
|
| 408 |
+
```bibtex
|
| 409 |
+
@misc{chen2026xiaomiocr0,
|
| 410 |
+
title = {Xiaomi-OCR-0 Technical Report},
|
| 411 |
+
author = {Chen, Xin and Du, Anan and Feng, Feng and Fu, Pei and Luan, Jian and
|
| 412 |
+
Xu, Longwei and Zhang, Shaojie and Li, Hang and Qu, Heng and Tan, Cheng},
|
| 413 |
+
year = {2026},
|
| 414 |
+
eprint = {2609.36136},
|
| 415 |
+
archivePrefix= {arXiv},
|
| 416 |
+
primaryClass = {cs.CV},
|
| 417 |
+
url = {https://arxiv.org/abs/2609.36136}
|
| 418 |
+
}
|
| 419 |
+
```
|
README_zh.md
CHANGED
|
@@ -25,7 +25,7 @@ metrics:
|
|
| 25 |
<h1>Xiaomi-OCR-0</h1>
|
| 26 |
<p><b>0.8B 模型,统一文档解析与 OCR 相关理解。</b></p>
|
| 27 |
<p><a href="https://huggingface.co/SeerRay-Lab/Xiaomi-OCR-0/blob/main/README.md">English</a> · <b>简体中文</b></p>
|
| 28 |
-
<p><a href="https://huggingface.co/spaces/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/Project-Page-FF6900?logo=huggingface&logoColor=FFD21E" alt="Project Page"></a> <a href="https://github.com/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/GitHub-SeerRay--Lab%2FXiaomi--OCR--0-181717?logo=github" alt="GitHub"></a></p>
|
| 29 |
</div>
|
| 30 |
|
| 31 |
Xiaomi-OCR-0 是一个统一的 0.8B OCR 专用视觉语言模型,同时面向 **文档解析** 与 **OCR 中心理解**。
|
|
@@ -150,7 +150,7 @@ Xiaomi-OCR-0 在约 170M 样本的语料上训练,覆盖文档解析与 OCR
|
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
-
更多细节,包括这些结论背后的完整分析,见技术报告
|
| 154 |
|
| 155 |
## 🚀 使用
|
| 156 |
|
|
@@ -211,15 +211,6 @@ new_tokens = output[:, inputs["input_ids"].shape[1]:]
|
|
| 211 |
print(processor.batch_decode(new_tokens, skip_special_tokens=True)[0])
|
| 212 |
```
|
| 213 |
|
| 214 |
-
## 在 Agent 中体验
|
| 215 |
-
|
| 216 |
-
> ⚠️ **注意:** 经你授权后,这个 Skill 可能会创建 Python 环境、安装依赖、下载模型权重、安装并配置 SGLang 或 vLLM,以及注册 MCP 服务。模型和版面分析权重可能较大。如果你不同意这种安装流程,请不要执行下面的命令。
|
| 217 |
-
|
| 218 |
-
```
|
| 219 |
-
Read and execute https://raw.githubusercontent.com/SeerRay-Lab/Xiaomi-OCR-0/main/SKILL.md
|
| 220 |
-
```
|
| 221 |
-
|
| 222 |
-
模型在你的机器上运行。
|
| 223 |
|
| 224 |
### 任务提示词
|
| 225 |
|
|
@@ -414,4 +405,17 @@ Xiaomi-OCR-0 建立在开放的 OCR 与多模态大模型社区之上,感谢
|
|
| 414 |
## 引用与许可
|
| 415 |
|
| 416 |
- **许可证:** Apache-2.0
|
| 417 |
-
- **论文
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
<h1>Xiaomi-OCR-0</h1>
|
| 26 |
<p><b>0.8B 模型,统一文档解析与 OCR 相关理解。</b></p>
|
| 27 |
<p><a href="https://huggingface.co/SeerRay-Lab/Xiaomi-OCR-0/blob/main/README.md">English</a> · <b>简体中文</b></p>
|
| 28 |
+
<p><a href="https://huggingface.co/spaces/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/Project-Page-FF6900?logo=huggingface&logoColor=FFD21E" alt="Project Page"></a> <a href="https://github.com/SeerRay-Lab/Xiaomi-OCR-0"><img src="https://img.shields.io/badge/GitHub-SeerRay--Lab%2FXiaomi--OCR--0-181717?logo=github" alt="GitHub"></a> <a href="https://arxiv.org/abs/2609.36136"><img src="https://img.shields.io/badge/arXiv-2609.36136-B31B1B?logo=arxiv" alt="arXiv"></a></p>
|
| 29 |
</div>
|
| 30 |
|
| 31 |
Xiaomi-OCR-0 是一个统一的 0.8B OCR 专用视觉语言模型,同时面向 **文档解析** 与 **OCR 中心理解**。
|
|
|
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
+
更多细节,包括这些结论背后的完整分析,见[技术报告](https://arxiv.org/abs/2609.36136)。
|
| 154 |
|
| 155 |
## 🚀 使用
|
| 156 |
|
|
|
|
| 211 |
print(processor.batch_decode(new_tokens, skip_special_tokens=True)[0])
|
| 212 |
```
|
| 213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 214 |
|
| 215 |
### 任务提示词
|
| 216 |
|
|
|
|
| 405 |
## 引用与许可
|
| 406 |
|
| 407 |
- **许可证:** Apache-2.0
|
| 408 |
+
- **论文:** [Xiaomi-OCR-0 Technical Report](https://arxiv.org/abs/2609.36136)(arXiv:2609.36136)
|
| 409 |
+
|
| 410 |
+
```bibtex
|
| 411 |
+
@misc{chen2026xiaomiocr0,
|
| 412 |
+
title = {Xiaomi-OCR-0 Technical Report},
|
| 413 |
+
author = {Chen, Xin and Du, Anan and Feng, Feng and Fu, Pei and Luan, Jian and
|
| 414 |
+
Xu, Longwei and Zhang, Shaojie and Li, Hang and Qu, Heng and Tan, Cheng},
|
| 415 |
+
year = {2026},
|
| 416 |
+
eprint = {2609.36136},
|
| 417 |
+
archivePrefix= {arXiv},
|
| 418 |
+
primaryClass = {cs.CV},
|
| 419 |
+
url = {https://arxiv.org/abs/2609.36136}
|
| 420 |
+
}
|
| 421 |
+
```
|