Model reference · open weights
GOT-OCR2_0 is an open-weight language model from stepfun-ai. GOT-OCR2_0 (BF16) weighs 1.4 GB; the smallest configuration that runs it is RTX 3060 12 GB.
Summary of the stepfun-ai/GOT-OCR2_0 model card, 2026-10-01
What it is
| Released by | stepfun-ai |
|---|---|
| Released | 2024-09-12 |
| Parameters | 716M |
| VRAM | 1.4 GB for the weights |
What it runs on
| Card | Requests at once | Context max | Memory | |
|---|---|---|---|---|
| 8K each | 32K each | |||
| RTX 3060 12 GB | 11 | 2 | all 32K | 11.6 GB |
| RTX 4060 Ti 16 GB | 16 | 4 | all 32K | 15.4 GB |
| RTX 3090 24 GB | 26 | 6 | all 32K | 23.4 GB |
| RTX 4090 24 GB | 26 | 6 | all 32K | 23.4 GB |
| RTX 5090 32 GB | 35 | 8 | all 32K | 31.0 GB |
| L40S 48 GB | 52 | 13 | all 32K | 44.0 GB |
| A100 80 GB | 94 | 23 | all 32K | 78.2 GB |
| H100 80 GB | 89 | 22 | all 32K | 78.1 GB |
| RTX PRO 6000 Blackwell 96 GB | 109 | 27 | all 32K | 93.8 GB |
| DGX Spark (GB10) 128 GB unified | 125 | 31 | all 32K | 107 GB |
| H200 141 GB | 163 | 40 | all 32K | 138 GB |
| B200 180 GB | 211 | 52 | all 32K | 176 GB |
| Requests at once | 8K tokens each | 32K tokens each |
|---|---|---|
| 1 | 2.9 GB | 5.3 GB |
| 5 | 6.1 GB | 18.2 GB |
| 8 | 8.5 GB | 27.8 GB |
| 16 | 14.9 GB | 53.6 GB |
| 32 | 27.8 GB | 105 GB |
| 64 | 53.6 GB | 208 GB |
One card, with vLLM's small-card settings.
From the model card
🔋Online Demo | 🌟GitHub | 📜Paper
Haoran Wei*, Chenglong Liu*, Jinyue Chen, Jia Wang, Lingyu Kong, Yanming Xu, Zheng Ge, Liang Zhao, Jianjian Sun, Yuang Peng, Chunrui Han, Xiangyu Zhang
Inference using Huggingface transformers on NVIDIA GPUs. Requirements tested on python 3.10:
torch==2.0.1
torchvision==0.15.2
transformers==4.37.2
tiktoken==0.6.0
verovio==4.3.1
accelerate==0.28.0
from transformers import AutoModel, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True)
model = AutoModel.from_pretrained('ucaslcl/GOT-OCR2_0', trust_remote_code=True, low_cpu_mem_usage=True, device_map='cuda', use_safetensors=True, pad_token_id=tokenizer.eos_token_id)
model = model.eval().cuda()
# input your test image
image_file = 'xxx.jpg'
# plain texts OCR
res = model.chat(tokenizer, image_file, ocr_type='ocr')
# format texts OCR:
# res = model.chat(tokenizer, image_file, ocr_type='format')
# fine-grained OCR:
# res = model.chat(tokenizer, image_file, ocr_type='ocr', ocr_box='')
# res = model.chat(tokenizer, image_file, ocr_type='format', ocr_box='')
# res = model.chat(tokenizer, image_file, ocr_type='ocr', ocr_color='')
# res = model.chat(tokenizer, image_file, ocr_type='format', ocr_color='')
# multi-crop OCR:
# res = model.chat_crop(tokenizer, image_file, ocr_type='ocr')
# res = model.chat_crop(tokenizer, image_file, ocr_type='format')
# render the formatted OCR results:
# res = model.chat(tokenizer, image_file, ocr_type='format', render=True, save_render_file = './demo.html')
print(res)
More details about 'ocr_type', 'ocr_box', 'ocr_color', and 'render' can be found at our GitHub. Our training codes are available at our GitHub.
👏 Welcome to explore more multimodal projects of our team:
If you find our work helpful, please consider citing our papers 📝 and liking this project ❤️!
@article{wei2024general,
title={General OCR Theory: Towards OCR-2.0 via a Unified End-to-end Model},
author={Wei, Haoran and Liu, Chenglong and Chen, Jinyue and Wang, Jia and Kong, Lingyu and Xu, Yanming and Ge, Zheng and Zhao, Liang and Sun, Jianjian and Peng, Yuang and others},
journal={arXiv preprint arXiv:2409.01704},
year={2024}
}
@article{liu2024focus,
title={Focus Anywhere for Fine-grained Multi-page Document Understanding},
author={Liu, Chenglong and Wei, Haoran and Chen, Jinyue and Kong, Lingyu and Ge, Zheng and Zhu, Zining and Zhao, Liang and Sun, Jianjian and Han, Chunrui and Zhang, Xiangyu},
journal={arXiv preprint arXiv:2405.14295},
year={2024}
}
@article{wei2023vary,
title={Vary: Scaling up the Vision Vocabulary for Large Vision-Language Models},
author={Wei, Haoran and Kong, Lingyu and Chen, Jinyue and Zhao, Liang and Ge, Zheng and Yang, Jinrong and Sun, Jianjian and Han, Chunrui and Zhang, Xiangyu},
journal={arXiv preprint arXiv:2312.06109},
year={2023}
}
Quoted from the model card on Hugging Face. The full card is behind the Hugging Face link above.