/ Модель

Характеристики

Контекст
32 768 токенов
Параметры
560 млн
Лицензия
MIT
Архитектура
unlimited-ocr · dense
Базовая модель
Unlimited-OCR
Библиотека
transformers
Опубликована
23 июн 2026

Unlimited-OCR-AWQ

Генерация текстаТекст → текст15 профессий

sahilchachra/Unlimited-OCR-AWQ — это квантизированная 4-битная версия мультимодальной модели baidu/Unlimited-OCR, разработанная пользователем sahilchachra.

1,1 млнскачиваний за 30 дней7лайковвеса обновлены23 июн 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Модель предназначена для multilingual OCR и разбора документов: преобразования изображений документов в Markdown или обычный текст, извлечения текста с координатами, анализа макета, обработки рисунков, графиков и диаграмм, визуального вопросно-ответного взаимодействия, а также разбора многостраничных документов и PDF.

Архитектура включает vision tower DeepEncoder на базе SAM-ViT-B и CLIP-L/14 с входом 1024×1024 и 16-кратным уменьшением, линейный projector и текстовый декодер DeepSeek-V2 MoE. Декодер содержит 12 слоёв, скрытое состояние размером 1280, 64 маршрутизируемых и 2 общих эксперта, при этом на токен выбираются 6 экспертов; нулевой слой является dense. Текстовые линейные слои квантизированы методом AWQ по схеме W4A16 с int4, симметричными группами по 128 элементов, тогда как vision tower, projector, embeddings, lm_head, маршрутизатор, нормы и отдельные слои сохранены в BF16. Модель поддерживает мультиязычные сценарии и работает с изображениями.

К сильным сторонам относятся существенное уменьшение размера весов при сохранении совместимости с архитектурой Transformers, поддержка распознавания текста вместе с координатами ограничивающих рамок и долгого разбора документов. В README указано, что на тестовом документе результат OCR совпал с BF16-версией. Для запуска требуется custom remote code с параметром trust_remote_code=True, transformers 4.57.x, compressed-tensors и CUDA GPU; также возможен запуск в совместимых средах, включая vLLM. Модель распространяется по лицензии MIT, унаследованной от базовой модели.

Для каких профессий подходит15

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Unlimited-OCR — AWQ (W4A16)

AWQ 4-bit (W4A16) quantization of baidu/Unlimited-OCR, a 3B vision-language OCR model that pushes DeepSeek-OCR one step further (one-shot, long-horizon document parsing). This repo quantizes the DeepSeek-V2 MoE text decoder with activation-aware scaling (AWQ) while keeping the vision tower in BF16, so it stays a drop-in transformers model.

⚠️ Runtime requirements. This is custom remote code, so load with trust_remote_code=True, transformers 4.57.x, and compressed-tensors installed. W4A16 (int4) runs on any CUDA GPU; compressed-tensors handles the 4-bit unpacking at load.

This quant

SchemeW4A16 · int4 symmetric · group 128 · pack-quantized
MethodAWQ (llm-compressor) — activation-aware, text-calibrated
Calibration64 × 512-token general-text sequences (text-only forward)
Quantizedtext-decoder Linears (attention q/k/v/o, all experts + shared gate/up/down, dense gate/up)
Kept in BF16vision tower (sam_model, vision_model), projector, token embeddings, lm_head, the MoE router gate, all norms, and the single dense layer-0 down_proj (width 6848 not divisible by group 128)
Quantized bysahilchachra

Quick start

pip install "transformers==4.57.3" compressed-tensors accelerate torch torchvision \
            einops addict easydict matplotlib pillow
import torch
from transformers import AutoModel, AutoTokenizer

repo = "sahilchachra/Unlimited-OCR-AWQ"
tok = AutoTokenizer.from_pretrained(repo, trust_remote_code=True)
model = AutoModel.from_pretrained(repo, trust_remote_code=True,
                                  dtype=torch.bfloat16, device_map="cuda").eval()

text = model.infer(
    tok,
    prompt="<image>\n<|grounding|>Convert the document to markdown.",
    image_file="document.png", output_path="./out",
    base_size=1024, image_size=1024, crop_mode=False,   # "base" mode
    save_results=True, eval_mode=True,
)
print(text)

Prompting guide

Unlimited-OCR uses the DeepSeek-OCR prompt vocabulary. The prompt must contain <image>; prefix it with <|grounding|> whenever you also want bounding boxes for what was read.

TaskPrompt
Document → Markdown (layout-aware, with boxes)`\n<
Plain text OCR (just the text, no layout)<image>\nFree OCR.
OCR with bounding boxes`\n<
Native Unlimited-OCR parse<image>document parsing.
Parse a figure / chart / diagram<image>\nParse the figure.
Describe the image (general VQA)<image>\nDescribe this image in detail.
Find specific text (referring grounding)`\n<
Multi-page / PDF<image>Multi page parsing. via model.infer_multi(...)

Resolution modes

  • base — base_size=1024, image_size=1024, crop_mode=False. Good default for normal pages.
  • gundam — base_size=1024, image_size=640, crop_mode=True. Tiles the page; use for dense or large/high-resolution documents.

Understanding the output (grounding tokens)

With <|grounding|>, the model interleaves the recognized text with detection boxes:

<|det|>title [37, 64, 464, 132]<|/det|>INVOICE #2026-0623
<|det|>text  [37, 194, 350, 247]<|/det|>Bill To: Sahil Chachra
<|det|>text  [37, 483, 329, 543]<|/det|>Total Due: $44.00

Each [x1, y1, x2, y2] is the bounding box (top-left → bottom-right) of that span, in the coordinate space of the model's input image. Drop the <|det|>...<|/det|> tags if you only want text, or parse them to overlay boxes / rebuild layout. Without <|grounding|> you get plain text (or Markdown) with no box tags.

Serving

The original model ships an SGLang wheel and a vLLM path (see the base model card). W4A16 / compressed-tensors weights load directly in runtimes with compressed-tensors support (e.g. vLLM); otherwise use the transformers snippet above.

About the model

  • Architecture: UnlimitedOCRForCausalLM (DeepSeek-OCR architecture) — a DeepEncoder vision tower (SAM-ViT-B + CLIP-L/14, 1024×1024 input, 16× downsample) → linear projector → DeepSeek-V2 MoE text decoder (12 layers, hidden 1280, 64 routed + 2 shared experts, 6 experts/token; layer 0 dense).
  • Task: multilingual OCR / document parsing — single image, multi-page, and PDF (one-shot long-horizon parsing).
  • License: MIT (inherited from the base model).

How this was made

Unlimited-OCR is custom remote code whose forward only runs the vision tower when images are passed, so AWQ calibration feeds text only (images=None), exercising the pure DeepSeek-V2 decoder. Per-layer AWQ mappings were built from the live module tree (attention input_layernorm→q,k,v and v→o; MoE post_attention_layernorm→ every expert + shared-expert gate/up, plus per-expert up→down). The fx-based "sequential" pipeline can't trace this custom model, so the basic pipeline (real end-to-end forward + activation hooks) was used.

Verified

Loaded in transformers and run on a test document — OCR output matches BF16, e.g.:

<|det|>title [37, 64, 464, 130]<|/det|>INVOICE #2026-0623
<|det|>text  [37, 480, 329, 540]<|/det|>Total Due: $44.00

Limitations

  • 4-bit weights trade a little accuracy for size; for the highest fidelity use the original BF16 model. For OCR, this AWQ build is effectively lossless on tested documents.
  • The vision encoder and MoE router stay BF16 (small, accuracy-sensitive).
  • English-/multilingual-text centric; verify critical fields on hard scans.

Other formats

Credits

Base model baidu/Unlimited-OCR (MIT), built on DeepSeek-OCR. Quantized with llm-compressor. License: MIT.

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

vLLM

Нельзя запустить

Модели нужен код из репозитория; запуск откроется после проверки совместимости.

Класс архитектуры
UnlimitedOCRForCausalLM
Ревизия весов
0ad8e3c

0 моделей