kora-v0.1

๐Ÿ““ Notebook: kora_inference.ipynb (download). It loads the model once and OCRs images or PDF pages, showing each page next to its Markdown. It runs on Google Colab (upload it with File โ†’ Upload notebook and pick a GPU runtime) or locally (NVIDIA GPU, Apple GPU or CPU).

kora-v0.1 is an OCR model for Hindi and English document pages. It turns a page image into Markdown: headings, lists and bold text as Markdown, tables as HTML, math as LaTeX, pictures as ![image](image_N.png) placeholders. Headers, footers and page numbers are kept, and digits are written in the script they're printed in.

Quick start

import torch
from PIL import Image
from transformers import AutoProcessor, Qwen3_5ForConditionalGeneration

model_id = "shubhdotai/kora-v0.1"
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
processor = AutoProcessor.from_pretrained(model_id)
model = Qwen3_5ForConditionalGeneration.from_pretrained(
    model_id, dtype=torch.float32 if device == "cpu" else torch.bfloat16).to(device).eval()

img = Image.open("page.png").convert("RGB")
img.thumbnail((1540, 1540))                                  # longest edge at most 1,540 px
prompt = processor.apply_chat_template([{"role": "user", "content": [{"type": "image"}]}],
                                       add_generation_prompt=True, tokenize=False, enable_thinking=False)
inputs = processor(text=[prompt], images=[img], return_tensors="pt").to(device)
end = processor.tokenizer.convert_tokens_to_ids("<|im_end|>")
out = model.generate(**inputs, max_new_tokens=6144, do_sample=False, eos_token_id=end)
print(processor.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True))

Requires transformers 5.5.4 or newer.

Tips

  • Input: one page per image, with no text prompt. Render PDFs at 200 DPI and keep the longest edge at 1,540 px or less (the notebook does both).
  • Repetition: if a page's output starts repeating and runs to the length cap, run it again with repetition_penalty=1.05.
  • Precision: bf16 on recent GPUs and Apple silicon; use fp32 on a T4 or a CPU.

License

Apache-2.0. Based on lightonai/LightOnOCR-3-0.8B (Apache-2.0).

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

Model tree for shubhdotai/kora-v0.1

Finetuned
(4)
this model