Model reference · open weights
GOT-OCR-2.0 is an open-weight language model from stepfun-ai, listed in the AxForge catalogue. AxForge can bring it up on EU-owned hardware for you on request — with the licence handled where one is required.
About
🤗 Spaces Demo | 🌟GitHub | 📜Paper</a Haoran Wei, Chenglong Liu, Jinyue Chen, Jia Wang, Lingyu Kong, Yanming Xu, Zheng Ge, Liang Zhao, Jianjian Sun, Yuang Peng, Chunrui Han, Xiangyu Zhang Tips: GOT-OCR2 works on a wide range of tasks, including plain document OCR, scene text OCR, formatted document OCR, and even OCR for tables, charts, mathematical formulas, geometric shapes, molecular formulas and sheet music. While this implementation of the model will only output plain text, the outputs can be further processed to render the desired format, with packages like pdftex, mathpix, matplotlib, tikz, verovio or pyecharts. The model can also be used for interactive OCR, where the user can specify the region to be recognized by providing the coordinates or the color of the region's bounding box. This model was contributed by yonigozlan. The original code can be found here. Usage example Plain text inference Plain text inference batched Formatted text inference GOT-OCR2 can also generate formatted text, such as markdown or LaTeX. Here is an example of how to generate formatted text: Inference on multiple pages Although it might be reasonable in most cases to use a “for loop” for multi-page processing, some text data with formatting across several pages make it necessary to process all pages at once. GOT introduces a multi-page OCR (without “for loop”) feature, where multiple pages can be processed by the model at once, whith the output being one continuous text. Here is an example of how to process multiple pages at once: Inference on cropped patches GOT supports a 1024×1024 input resolution, which is sufficient for most OCR tasks, such as scene OCR or processing A4-sized PDF pages. However, certain scenarios, like horizontally stitched two-page PDFs commonly found in academic papers or images with unusual aspect ratios, can lead to accuracy issues when processed as a single image. To address this, GOT can dynamically crop an image into patches, process them all at once, and merge the results for better accuracy with such inputs. Here is an example of how to process cropped patches: Inference on a specific region GOT supports interactive OCR, where the user can specify t
Summarised from the published model card. Read the full card on the HuggingFace links below.
Specifications
| Maker | stepfun-ai |
|---|---|
| Type | Language models |
| Parameters (lead) | 561M |
| Variants | 1 |
| Runs with | transformers |
| Released | 2024-11-22 |
| Popularity | 178k downloads / month |
| Likes | 240 |
| Licence | Open weights |
How it works
Variants
Open weights ship in several sizes and precisions. One page, all the variants — pick the one that fits your GPU. VRAM figures are estimates from model size.
| Variant | Params | Precision | VRAM | Fits 16 GB | Weights |
|---|---|---|---|---|---|
| GOT-OCR-2.0-hf | 561M | BF16 | ~1.3 GB | ✓ | Weights ↗ |
Using it via the API
Once AxForge deploys got-ocr-2-0 for you, it answers on the OpenAI-compatible API — the same base URL and keys as every other model. (got-ocr-2-0 below is illustrative; you get the exact model name on deployment.)
$ curl -sS https://api.axforge.ai/v1/chat/completions \
-H "Authorization: Bearer $AXFORGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"got-ocr-2-0","messages":[{"role":"user","content":"Hello"}]}'
Details
Languages
Tags
Papers
Licence
Open weights under apache-2.0 — commercial use is permitted. Deploy it on AxForge EU hardware on request. Read the licence ↗