Run this model with HF Jobs
Run epoch-discovery/ep-hindi-ocr 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/epoch-discovery/ep-hindi-ocr. Ask me which dataset to train on, then push the fine-tuned model to a new private 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/epoch-discovery/ep-hindi-ocr 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/epoch-discovery/ep-hindi-ocr. Ask me which benchmark to run, then save the scores and the per-example results to a new private 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/epoch-discovery/ep-hindi-ocr. Push it to a new private model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use epoch-discovery/ep-hindi-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use epoch-discovery/ep-hindi-ocr with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="epoch-discovery/ep-hindi-ocr", trust_remote_code=True) 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 AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("epoch-discovery/ep-hindi-ocr", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use epoch-discovery/ep-hindi-ocr with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "epoch-discovery/ep-hindi-ocr" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "epoch-discovery/ep-hindi-ocr", "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/epoch-discovery/ep-hindi-ocr
- SGLang
How to use epoch-discovery/ep-hindi-ocr 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 "epoch-discovery/ep-hindi-ocr" \ --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": "epoch-discovery/ep-hindi-ocr", "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 "epoch-discovery/ep-hindi-ocr" \ --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": "epoch-discovery/ep-hindi-ocr", "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 epoch-discovery/ep-hindi-ocr with Docker Model Runner:
docker model run hf.co/epoch-discovery/ep-hindi-ocr
Fine-tuned from NVIDIA Nemotron 3.5 Parse.
Hindi OCR model (0.63B parameters) that runs on CPU. Full-precision weights.
Benchmark
Sarvam Indic OCR Bench, Hindi (228 samples), official scorer.
| Measure | Value |
|---|---|
| Word accuracy, all 228 samples | 86.45 % |
| Word accuracy, 152 samples never used in training or for selection | 86.36 % |
| Character error rate | 6.32 % |
| Base model (Nemotron 3.5 Parse) | 70.27 % ¹ |
¹ The base model gave no answer for 55 of the 228 samples; the official scorer leaves these out.
| Model | Word accuracy |
|---|---|
| Sarvam Vision 2.1 | 93.52 % |
| Gemini 3.6 Flash | 92.11 % |
| Bodhan Indic-OCR | 90.99 % |
| ep-hindi-ocr | 86.45 % |
| Surya OCR | 86.12 % |
| Chandra OCR | 83.18 % |
| Nemotron 3.5 Parse (base) | 70.27 % |
Scores of other systems are as published by their authors.
Examples
Samples from the benchmark that were never used in training.
A printed paragraph (word accuracy 100 %)
भारतवर्ष में काच की चूड़ियाँ बनाने का उद्योग बहुत प्राचीन काल से चला आता है और आज भी शायद उसी तरह की काच की भट्टियां विभिन्न स्थानों में काम कर रही हैं जैसी पुराने ज़माने में होती थीं। काच एक अत्यन्त उपयोगी पदार्थ है और इस से नाना प्रकार की वस्तुयें बनाई जाती हैं। बर्तन; खिड़कियों और मोटरों में लगाने के शीशे; कैमरा, टेलिस्कोप इत्यादि वैज्ञानिक यंत्रों में लगाये जाने वाले लेन्स; लाल्टेनों की चिमनियाँ; बिजली के बल्ब; इत्यादि इत्यादि, हज़ारों ऐसी वस्तुऐं काच की बनती हैं जिनके बिना हमारा काम चलना मुश्किल हो जाय।
A dense dictionary page, 528 words (word accuracy 92.8 %, first lines shown)
कारण उत्पन्न करना या आविष्कार करना; २. उत्पन्न होना, व्युत्पन्न होना, उद्भूत होना(साधारणतः किसी वस्तु या स्थान से या में from या in के साथ, व्यक्ति में या से with या from के साथ)।origination सं० १. उद्भव, जन्म, व्युत्पत्ति, आरंभ, उपक्रमण, आविष्करण; २. (मा० १) प्रारंभण*। originative वि० प्रारंभकारी, आरंभकारी, उत्पादकीय, प्रवर्तकीय, व्युत्पादकीय, आविष्करणीय । …
Speed
GPU (1× H100, vLLM, bfloat16)
| Input | Concurrent requests | Items / s | Output tokens / s | Median latency |
|---|---|---|---|---|
| Hindi pages (155 held-out pages) | 64 | 12.4 | 21,697 | 3.5 s |
| Hindi pages | 256 | 20.3 | 35,602 | 9.6 s |
| Text blocks (Sarvam Hindi) | 256 | 48.0 | 18,628 | 2.5 s |
CPU (transformers, float32 original weights, one request)
| Input | Threads | Median time | Output tokens / s |
|---|---|---|---|
| Text block (60–580 characters) | 16 | 15.3 s | 10.1 |
| Full page (1,100–2,100 characters) | 16 | 172 s | 9.5 |
| Text block | 4 | 12.4 s | 8.7 |
Usage
import re
import torch
from PIL import Image
from transformers import AutoModel, AutoProcessor, GenerationConfig
repo = "epoch-discovery/ep-hindi-ocr"
model = AutoModel.from_pretrained(repo, trust_remote_code=True, dtype=torch.float32).eval()
processor = AutoProcessor.from_pretrained(repo, trust_remote_code=True)
gen = GenerationConfig.from_pretrained(repo)
gen.max_new_tokens = 4096
PROMPT = "</s><s><no_bbox><no_classes><output_plain><predict_text_in_pic>" # plain-text prompt
image = Image.open("hindi_text.png").convert("RGB")
inputs = processor(images=[image], text=PROMPT, return_tensors="pt", add_special_tokens=False)
with torch.inference_mode():
ids = model.generate(**inputs, generation_config=gen)
raw = processor.batch_decode([ids[0, inputs["input_ids"].shape[1]:]], skip_special_tokens=False)[0]
text = re.sub(r"\n{2,}", "\n", re.sub(r"<[^>]+>", "\n", raw)).strip()
print(text)
Or use the included script:
python inference.py page.png
Licence
- Licensed under the Indic Open Model License v1.0.
- Built with Indic-OCR from Bodhan AI / AI4Bharat.
- Base model: nvidia/Nemotron-3.5-Parse (OpenMDW-1.1; NVIDIA licence files are included as
NVIDIA_*).
- Downloads last month
- 2
Model tree for epoch-discovery/ep-hindi-ocr
Base model
nvidia/Nemotron-3.5-Parse
