AI SeedbankHelp preserve open and free AI for humanity's future

← All models

allenai_olmOCR-2-7B-1025

allenai · View on Hugging Face ↗

Get this model

Download TorrentMagnet Link

Seeders: · Leechers:

Model card

The complete upstream card, rendered from this payload's README.md — the same hash-verified bytes the torrent distributes. Images and off-site links are removed; the original card on Hugging Face carries them.


license: apache-2.0 language:

  • en base_model:
  • Qwen/Qwen2.5-VL-7B-Instruct library_name: transformers

olmOCR-2-7B-1025

Full BF16 version of olmOCR-2-7B-1025-FP8. We recommend using the FP8 version for all practical purposes except further fine tuning.

This is a release of the olmOCR model that's fine tuned from Qwen2.5-VL-7B-Instruct using the olmOCR-mix-1025 dataset. It has been additionally fine tuned using GRPO RL training to boost its performance at math equations, tables, and other tricky OCR cases.

Quick links:

The best way to use this model is via the olmOCR toolkit. The toolkit comes with an efficient inference setup via VLLM that can handle millions of documents at scale.

olmOCR-Bench Scores

This model scores the following scores on olmOCR-bench when used with the olmOCR toolkit toolkit which automatically renders, rotates, and retries pages as needed.

Model ArXiv Old Scans Math Tables Old Scans Headers and Footers Multi column Long tiny text Base Overall
olmOCR pipeline v0.4.0 with olmOCR-2-7B-1025 82.9 82.1 84.3 48.3 95.7 84.3 81.4 99.7 82.3 ± 1.1
olmOCR pipeline v0.4.0 with olmOCR-2-7B-1025-FP8 83.0 82.3 84.9 47.7 96.1 83.7 81.9 99.7 82.4 ± 1.1

Usage

This model expects as input a single document image, rendered such that the longest dimension is 1288 pixels.

The prompt must then contain the additional metadata from the document, and the easiest way to generate this is to use the methods provided by the olmOCR toolkit.

Manual Prompting

If you want to prompt this model manually instead of using the olmOCR toolkit, please see the code below.

In normal usage, the olmOCR toolkit builds the prompt by rendering the PDF page, and extracting relevant text blocks and image metadata. To duplicate that you will need to

pip install olmocr>=0.4.0

and then run the following sample code.

import torch
import base64
import urllib.request

from io import BytesIO
from PIL import Image
from transformers import AutoProcessor, Qwen2_5_VLForConditionalGeneration

from olmocr.data.renderpdf import render_pdf_to_base64png
from olmocr.prompts import build_no_anchoring_v4_yaml_prompt

# Initialize the model
model = Qwen2_5_VLForConditionalGeneration.from_pretrained("allenai/olmOCR-2-7B-1025", torch_dtype=torch.bfloat16).eval()
processor = AutoProcessor.from_pretrained("Qwen/Qwen2.5-VL-7B-Instruct")
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)

# Grab a sample PDF
urllib.request.urlretrieve("https://olmocr.allenai.org/papers/olmocr.pdf", "./paper.pdf")

# Render page 1 to an image
image_base64 = render_pdf_to_base64png("./paper.pdf", 1, target_longest_image_dim=1288)


# Build the full prompt
messages = [
            {
                "role": "user",
                "content": [
                    {"type": "text", "text": build_no_anchoring_v4_yaml_prompt()},
                    {"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_base64}"}},
                ],
            }
        ]

# Apply the chat template and processor
text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
main_image = Image.open(BytesIO(base64.b64decode(image_base64)))

inputs = processor(
    text=[text],
    images=[main_image],
    padding=True,
    return_tensors="pt",
)
inputs = {key: value.to(device) for (key, value) in inputs.items()}


# Generate the output
output = model.generate(
            **inputs,
            temperature=0.1,
            max_new_tokens=50,
            num_return_sequences=1,
            do_sample=True,
        )

# Decode the output
prompt_length = inputs["input_ids"].shape[1]
new_tokens = output[:, prompt_length:]
text_output = processor.tokenizer.batch_decode(
    new_tokens, skip_special_tokens=True
)

print(text_output)
# ['---\nprimary_language: en\nis_rotation_valid: True\nrotation_correction: 0\nis_table: False\nis_diagram: False\n---\nolmOCR: Unlocking Trillions of Tokens in PDFs with Vision Language Models\n\nJake Poz']

License and use

This model is licensed under Apache 2.0. It is intended for research and educational use in accordance with Ai2's Responsible Use Guidelines.

Magnet link

Opens the swarm directly in your torrent client — no file download needed. Copy-paste works too:

magnet:?xt=urn:btih:dd7dd5ce03a34c205865b754c3276d867dee27c9&dn=allenai_olmOCR-2-7B-1025

Open magnet in torrent client · infohash dd7dd5ce03a34c205865b754c3276d867dee27c9

Files & hashes

PathSizesha1sha256
README.md6.0 KB (6,139 B)ca1225425b13020df1690fcbcbf0e3e3a89cec85651827a702c15ba145c46f5a34338563d455068a68038f173400e90fd78b00f8
added_tokens.json605 B (605 B)482ced4679301bf287ebb310bdd1790eb451423258b54bbe36fc752f79a24a271ef66a0a0830054b4dfad94bde757d851968060b
chat_template.jinja1017 B (1,017 B)6c226632394ae7474b0d4b13e15793eac2e21ee9a0bc6f6fc7a29a80017a433e8f03a1cc1236e838a944a2d034295a60c4f2fddb
chat_template.json1.0 KB (1,050 B)732bd68bc5427d1fb6c06a59b3bf2456b2155d24ad60d90252ed0b0705ba14e2d0ad0fec0beac1ea955642b54059b36052d8bc96
config.json3.1 KB (3,219 B)9ae95d4b91f5d98fffdf33937ba97d7673eef4917daf88568646276440e7f51d9d5c7845925e92c9f54aa18c1f621f5029b4331d
generation_config.json260 B (260 B)8afc96fef3699eeba94060464f50bd489e748935f8f9e40b9d85636128865f0be3c696b915932049b6c25b087241f63f5ef4e785
latest14 B (14 B)bcf403eb0e834077354f7671dc603f7a64adfe1abdf1586d0f35cf1a2aabb39bd88270f5c060ad58e946b4284cf9133803e073a6
merges.txt1.6 MB (1,671,839 B)20024bfe7c83998e9aeaf98a0cd6a2ce6306c2f0599bab54075088774b1733fde865d5bd747cbcc7a547c5bc12610e874e26f5e3
model-00001-of-00004.safetensors4.63 GB (4,968,243,272 B)209a8f5283f75218e0018b7a2587940f89ace2e1f752fd105e3d9ecd4efc16cb5c40e9f97f46c0d0614e328b5723a74df4634561
model-00002-of-00004.safetensors4.65 GB (4,991,495,784 B)290c052c8b543afbc6e7881b0c9fcfe817811ca50bbaa22a46fdad5a68c733f59712e87e83dacfccfd0f14c300074992642bcd90
model-00003-of-00004.safetensors4.59 GB (4,932,751,008 B)224206bac26ebd4f9d8948623c1ef9012b82c11a41ecc0cc06829b18c2fdcd704c2c3032bafc3b51e79d73c5b536f9c142a07e2e
model-00004-of-00004.safetensors1.58 GB (1,691,924,352 B)266ab634d3145fe34148cade5a7a13905d47eff1ffca66cb61f6ad70364a095fee84ccf40597476f82649983003e41e305dfc5f8
model.safetensors.index.json56.3 KB (57,655 B)92b467639266f4aa72a9b5ab73dbdf5a1f936ee44be35310ddc165e46e88de4c3fec8c1210014b0b8717f4544d82cc740814ae0c
preprocessor_config.json350 B (350 B)7f3b746825e5eef53ed8ed57a91df9e86ee62c0af2058c716eef96ccaed1cc1e2d0c08306b62586d535b28d9d08e691b2fab7ca0
special_tokens_map.json613 B (613 B)ac23c0aaa2434523c494330aeb79c5839537810376862e765266b85aa9459767e33cbaf13970f327a0e88d1c65846c2ddd3a1ecd
tokenizer.json6.7 MB (7,031,645 B)443909a61d429dff23010e5bddd28ff530edda00c0382117ea329cdf097041132f6d735924b697924d6f6fc3945713e96ce87539
tokenizer_config.json5.6 KB (5,702 B)91684ea3dc135a7d815e2c932054ce88c1aab41f4abd3520120e266da84c0864fee064d1fb10806f02225911a47253dd38dc5f56
video_preprocessor_config.json907 B (907 B)6662e15042913e44162efcece6ee3bd643ffbcf109e98526bcd1b8584217418253badf2824ecf2815933b0583cdceb2e8f79ebb0
vocab.json2.6 MB (2,776,833 B)4783fe10ac3adce15ac8f358ef5462739852c569ca10d7e9fb3ed18575dd1e277a2579c16d108e32f27439684afa0e10b1440910
zero_to_fp32.py32.5 KB (33,270 B)5995d6e6f04e43b989587aa9022a3aef0c66d694e8a2553b434ac043ec63b022db1e768277acf8d4e70f10a2842db6d238977135

Cite this release

Canonical URL
https://aiseedbank.org/models/allenai_olmOCR-2-7B-1025/
Slug
allenai_olmOCR-2-7B-1025
Infohash
dd7dd5ce03a34c205865b754c3276d867dee27c9
License
apache-2.0
Signing key fingerprint
85a3b32c3712427b

Every file carries a locally computed sha256 — verify a download against the signed sums: allenai_olmOCR-2-7B-1025.SHA256SUMS (+ minisign signature).

Provenance

Upstream repositoryallenai/olmOCR-2-7B-1025
Revision (pinned)e52d6f090b7a9007afffbbd6ce510876222fea93
Fetched at2026-09-03T20:51:27Z
License at fetchapache-2.0
Snapshot toolhuggingface · seedbank 0.1.0

Trackers

✓ verified · rehash-vs-hf-metadata at 2026-09-03T20:54:17Z

apache-2.015.46 GB (16,596,005,534 bytes)transformerssafetensorsqwen2_5_vlimage-text-to-textconversationaltext-generation-inferenceendpoints_compatible1 language (en)