Run this model with HF Jobs

Run hitxhslhy/realocr on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs and TRL to fine-tune https://huggingface.co/hitxhslhy/realocr. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/hitxhslhy/realocr on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.

Evaluate on a benchmark

Use HF Jobs to evaluate https://huggingface.co/hitxhslhy/realocr. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.

Quantize for lower memory use

Use HF Jobs to create a 4-bit version of https://huggingface.co/hitxhslhy/realocr. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.

realocr

A 2B-parameter end-to-end document parsing model: page image in, full-page Markdown out. Built for the MDPBench protocol (17 languages, digital and photographed documents, 3,400 images).

This repository contains standalone bf16 weights for direct inference:

from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration
model = Qwen3_5ForConditionalGeneration.from_pretrained("hitxhslhy/realocr")
processor = AutoProcessor.from_pretrained("hitxhslhy/realocr")

Requires transformers>=5.3.0 (architecture Qwen3_5ForConditionalGeneration, model_type: qwen3_5).

How to run inference

pip install -r inference/requirements.txt

python inference/infer_mdpbench.py \
    --model  . \
    --image-dir /path/to/MDPBench_img_public \
    --out-dir   /path/to/result/our_model

Writes one .md per page image (filename = image stem) โ€” exactly what the MDPBench evaluation pipeline expects. See SUBMISSION_README.md for the full recipe and the exact inference settings, and VALIDATION.md for what was tested on real hardware.

Key settings that must be kept: official MDPBench prompt (embedded verbatim in inference/infer_mdpbench.py), greedy decoding, max_new_tokens=8192, native resolution (max_pixels=16777216), enable_thinking=False, and the Conv3d โ†’ Linear patch for the vision patch-embed (applied automatically by the script).

Note: the vision patch-embed is nn.Conv3d in stock transformers; on some GPUs this hits a pathological cuDNN kernel (~39.5 s per call, 99.8% of the forward pass). The provided script replaces it with a mathematically equivalent Linear matmul before loading.

Downloads last month
106
Safetensors
Model size
2B params
Tensor type
BF16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for hitxhslhy/realocr

Quantizations
1 model