Image-Text-to-Text
Safetensors
MLX
mlx-vlm
indic_ocr
ocr
document-parsing
layout-analysis
reading-order
indic
Instructions to use HashNuke/indic-ocr-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use HashNuke/indic-ocr-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("HashNuke/indic-ocr-mlx") config = load_config("HashNuke/indic-ocr-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Atomic Chat
File size: 2,116 Bytes
6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 6a0d82c 3ca5518 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | ---
tags:
- mlx
- ocr
- indic
library_name: mlx-vlm
pipeline_tag: image-text-to-text
license: other
license_name: indic-open-model-license-1.0
license_link: https://huggingface.co/HashNuke/indic-ocr-mlx/blob/main/LICENSE.md
base_model: bodhan-ai/indic-ocr
---
# IndicBlockOCR (MLX)
Built with IndicBlockOCR from Bodhan AI / AI4Bharat.
The recognition stage of [IndicOCR (MLX)](https://huggingface.co/HashNuke/indic-ocr-mlx):
a Qwen3.5-0.8B fine-tune for transcribing text, equations, and tables from
cropped document regions. The weights are BF16 (1.7 GB), not quantized.
Use an mlx-vlm checkout with `indic_ocr` support. Replace `crop.png` with an
image of a text region, not a complete multi-region page:
```python
from pathlib import Path
from huggingface_hub import snapshot_download
from PIL import Image
from mlx_vlm import generate, load
from mlx_vlm.models.indic_ocr.processing_indic_ocr import area_clamp, prompt_for
from mlx_vlm.prompt_utils import apply_chat_template
root = Path(snapshot_download(
"HashNuke/indic-ocr-mlx", allow_patterns=["weights/ocr/*"]
))
model, processor = load(str(root / "weights/ocr"))
with Image.open("crop.png") as image:
crop = area_clamp(image.convert("RGB"))
prompt = apply_chat_template(
processor, model.config, prompt_for("Text"), num_images=1
)
result = generate(
model, processor, prompt, [crop],
max_tokens=2048, temperature=0.0, verbose=False,
)
print(result.text)
```
Use `prompt_for("Equation")` for LaTeX or `prompt_for("Table")` for HTML
tables. Greedy decoding (`temperature=0.0`) matches the default page pipeline.
The repository root is a two-stage wrapper: `load("HashNuke/indic-ocr-mlx")`
does not load this OCR stage. Use the local `weights/ocr` path above, or
`IndicOCRParser.from_pretrained("HashNuke/indic-ocr-mlx")` for complete pages,
as shown in the [main model card](https://huggingface.co/HashNuke/indic-ocr-mlx).
The source weights are from [bodhan-ai/indic-ocr](https://huggingface.co/bodhan-ai/indic-ocr)
under the [Indic Open Model License v1.0](https://huggingface.co/HashNuke/indic-ocr-mlx/blob/main/LICENSE.md).
|