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.

You need to agree to share your Hugging Face information to access this model

This repository is publicly accessible, but you have to accept the conditions to access its files and content.

Log in or Sign Up to review the conditions and access this model content.

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

Hindi OCR word accuracy

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 %)

Printed Hindi paragraph

भारतवर्ष में काच की चूड़ियाँ बनाने का उद्योग बहुत प्राचीन काल से चला आता है और आज भी शायद उसी तरह की काच की भट्टियां विभिन्न स्थानों में काम कर रही हैं जैसी पुराने ज़माने में होती थीं। काच एक अत्यन्त उपयोगी पदार्थ है और इस से नाना प्रकार की वस्तुयें बनाई जाती हैं। बर्तन; खिड़कियों और मोटरों में लगाने के शीशे; कैमरा, टेलिस्कोप इत्यादि वैज्ञानिक यंत्रों में लगाये जाने वाले लेन्स; लाल्टेनों की चिमनियाँ; बिजली के बल्ब; इत्यादि इत्यादि, हज़ारों ऐसी वस्तुऐं काच की बनती हैं जिनके बिना हमारा काम चलना मुश्किल हो जाय।

A dense dictionary page, 528 words (word accuracy 92.8 %, first lines shown)

Hindi–English dictionary page

कारण उत्पन्न करना या आविष्कार करना; २. उत्पन्न होना, व्युत्पन्न होना, उद्भूत होना(साधारणतः किसी वस्तु या स्थान से या में 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

Downloads last month
2
Safetensors
Model size
0.6B params
Tensor type
F32
·
I64
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for epoch-discovery/ep-hindi-ocr

Finetuned
(11)
this model

Collection including epoch-discovery/ep-hindi-ocr