Nanonets-OCR-s
nanonets · nanonets/Nanonets-OCR-s
Weights license: Not declared by the source
Quality
No comparable score
We track no public, comparable benchmark that covers this model yet. No score is inferred.
Reported by the publisher
Runs on
Fast memory holds it 118
The planning estimate fits the memory the model can use quickly: graphics card VRAM, or unified memory within the macOS GPU share.
Show all 118
Within memory, outside the fast part 1
Within the machine's memory, outside its fast part: on a graphics card the layers that do not fit run on the CPU from PC RAM (the listed RAM, or 32 GB assumed); on a Mac, above the macOS default GPU share. Not a speed figure.
Hardware profiles grouped by the Q4 planning estimate on each machine (dedicated GPUs reserve 2 GB; unified and system memory 25%, 2 to 8 GB): the fast memory holds it, it is within memory but outside the fast part (layers offloaded to PC RAM, or above the macOS GPU share), or the machine is one memory tier short. Not a measured fit or speed.
Measured speed
No published measurement for this checkpoint
Tokens per second are shown only when a source publishes them with hardware, build and setup. They are never estimated.
How to run
Runtime compatibility and tokens per second have not been measured for this entry. Published metadata and a memory estimate do not prove a successful local run.
Library in source: transformers
Documented ways to run it
Copied as printed in the linked source (read 2026-10-18); not run by this site.
from PIL import Image
from transformers import AutoTokenizer, AutoProcessor, AutoModelForImageTextToText
model_path = "nanonets/Nanonets-OCR-s"
model = AutoModelForImageTextToText.from_pretrained(
model_path,
torch_dtype="auto",
device_map="auto",
attn_implementation="flash_attention_2"
)
model.eval()
tokenizer = AutoTokenizer.from_pretrained(model_path)
processor = AutoProcessor.from_pretrained(model_path)
def ocr_page_with_nanonets_s(image_path, model, processor, max_new_tokens=4096):
prompt = """Extract the text from the above document as if you were reading it naturally. Return the tables in html format. Return the equations in LaTeX representation. If there is an image in the document and image caption is not present, add a small description of the image inside the <img></img> tag; otherwise, add the image caption inside <img></img>. Watermarks should be wrapped in brackets. Ex: <watermark>OFFICIAL COPY</watermark>. Page numbers should be wrapped in brackets. Ex: <page_number>14</page_number> or <page_number>9/22</page_number>. Prefer using ☐ and ☑ for check boxes."""
image = Image.open(image_path)
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": [
{"type": "image", "image": f"file://{image_path}"},
{"type": "text", "text": prompt},
]},
]
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(text=[text], images=[image], padding=True, return_tensors="pt")
inputs = inputs.to(model.device)
output_ids = model.generate(**inputs, max_new_tokens=max_new_tokens, do_sample=False)
generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(inputs.input_ids, output_ids)]
output_text = processor.batch_decode(generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True)
return output_text[0]
image_path = "/path/to/your/document.jpg"
result = ocr_page_with_nanonets_s(image_path, model, processor, max_new_tokens=15000)
print(result)vllm serve nanonets/Nanonets-OCR-sTechnical details
What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.
- Checkpoint / source
- nanonets/Nanonets-OCR-s
- Task
- image-text-to-text
- Architecture
- Qwen2_5_VLForConditionalGeneration
- Library in source
- transformers
- Languages
- enModel card metadata · read 2026-10-25source
Every stored field
- Revision checked
- 3baad182cc87c65a1861f0c30357d3467e978172
- Architecture
- Qwen2_5_VLForConditionalGeneration
- Library
- transformers
- Hub task tag
- image-text-to-text
- Declared base models
- Qwen/Qwen2.5-VL-3B-Instruct
- Formats
- safetensors, transformers
- Access
- Open download
- Publisher kind
- Official
- Hub parameter count
- 3,754,622,976safetensors.total
- Repository created
- 2025-06-10creation is not the model's release
- Repository updated
- 2025-06-20a commit is not a release date
- Hub downloads (30 days) · likes
- 5,570 · 1,605this repository only · read 2026-11-19
- Read from the Hub page
- transformers class, task tagsHub overview and file listing · read 2026-10-19
- Catalog state
- Hub config or weights found; no inventory benchmark link
Sources
Identity and published specifications come from the checkpoint page. Benchmark scores belong to the named release and do not measure speed on your computer.
Valid source snapshot: 2026-11-19. This source record has not received a complete technical review. Missing data remain unknown; a repository commit is not a model release date.






























































