Instructions to use shubhdotai/kora-v0.1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use shubhdotai/kora-v0.1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="shubhdotai/kora-v0.1") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("shubhdotai/kora-v0.1") model = AutoModelForMultimodalLM.from_pretrained("shubhdotai/kora-v0.1", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use shubhdotai/kora-v0.1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "shubhdotai/kora-v0.1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shubhdotai/kora-v0.1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/shubhdotai/kora-v0.1
- SGLang
How to use shubhdotai/kora-v0.1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "shubhdotai/kora-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shubhdotai/kora-v0.1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "shubhdotai/kora-v0.1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "shubhdotai/kora-v0.1", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use shubhdotai/kora-v0.1 with Docker Model Runner:
docker model run hf.co/shubhdotai/kora-v0.1
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  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
Model tree for shubhdotai/kora-v0.1
Base model
lightonai/LightOnOCR-3-0.8B