olmOCR-2-7B-1025-FP8
allenai · allenai/olmOCR-2-7B-1025-FP8
Weights license: Apache 2.0 · code and components may use other terms
Not benchmarked or estimated yet
No comparable score, no memory figure to match against hardware and no published speed measurement for this checkpoint. Nothing is guessed.
How to run
Runtime compatibility and speed have not been measured for this entry. Published metadata does not prove a successful local run; check the files and terms at the source first.
Documented ways to run it
Copied as printed in the linked source (read 2026-10-18); not run by this site.
pip install olmocr>=0.4.0import 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-FP8", device_map="auto").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']Technical details
What the source and the catalog store for this checkpoint. Missing fields are left out, never zero.
- Checkpoint / source
- allenai/olmOCR-2-7B-1025-FP8
- Task
- image-text-to-text
- Architecture
- Qwen2_5_VLForConditionalGeneration
- Library in source
- transformers
- Weight license
- Apache 2.0
- Commercial use
- Allowed Apache License 2.0 text (SPDX) · read 2026-10-18license text
- Languages
- enModel card metadata · read 2026-10-25source
Every stored field
- Revision checked
- 40bd7202494b8264ee17ada08b401b5aab7a9ce1
- Architecture
- Qwen2_5_VLForConditionalGeneration
- Library
- transformers
- Hub task tag
- image-text-to-text
- Declared base models
- Qwen/Qwen2.5-VL-7B-Instruct
- Formats
- transformers, safetensors
- Access
- Open download
- Publisher kind
- Official
- Repository created
- 2025-10-06creation is not the model's release
- Repository updated
- 2026-02-19a commit is not a release date
- Hub downloads (30 days) · likes
- 81,434 · 258this repository only · read 2026-10-25
- Catalog state
- Hub config or weights found; no inventory benchmark link
Sources
Valid source snapshot: 2026-09-26. This source record has not received a complete technical review. Missing data remain unknown; a repository commit is not a model release date.