Downloads · 30 days
0
commandeaw/DW-KhoTaeVL-OCR-Pro-26B-MLX-LoRA-v0.2
DW-KhoTaeVL-OCR-Pro-26B-MLX-LoRA-v0.2 is a image-text-to-text model from commandeaw. Use it for the image-text-to-text task on the model card, and read the license before you ship it in a product. It is set up for mlx-vlm. The card lists the license as apache-2.0.
A small LoRA for Gemma 4 26B-A4B MLX 4-bit, Thai OCR.
Downloads · 30 days
0
Access
Public
Updated May 2, 2026
Repo size
20.1 MB
Likes
0
Public
Click a slice to open those files.
.safetensors20.1 MB · 98%
From the Hugging Face model README
A small LoRA for Gemma 4 26B-A4B MLX 4-bit, Thai OCR.
Sibling to v0.1, not a replacement. v0.1 was sharp on short OCR but broke on full pages. v0.2 trades some of that sharpness back for full-page recovery. Same recipe, different training prompts.
| Eval | Metric | Base | v0.1 | v0.2 |
|---|---|---|---|---|
| ThaiOCRBench n=299 | DW-light | 0.5215 | 0.5382 | 0.5421 |
| ThaiOCRBench n=299 | CER | 3.130 | 1.792 | 2.278 |
| ThaiOCRBench n=299 | Full-page OCR | 0.638 | 0.496 | 0.629 |
| openthaigpt n=104 | DW-light | 0.9009 | 0.9079 | 0.8898 |
| openthaigpt n=104 | CER | 2.350 | 1.730 | 1.549 |
Overall score is tied with v0.1. Real movement is per-task: Full-page +0.13, Text recognition -0.04. Pick v0.1 for short OCR, v0.2 for documents.
from mlx_vlm import load, generate
from mlx_vlm.prompt_utils import apply_chat_template
from PIL import Image
model, processor = load(
"mlx-community/gemma-4-26b-a4b-it-4bit",
adapter_path="commandeaw/DW-KhoTaeVL-OCR-Pro-26B-MLX-LoRA-v0.2",
)
img = Image.open("doc.jpg").convert("RGB")
messages = [{"role": "user", "content": "ถอดข้อความทั้งหมดในเอกสารนี้"}]
prompt = apply_chat_template(processor, model.config, messages, num_images=1)
print(generate(model, processor, image=img, prompt=prompt, max_tokens=512, temp=0.0).text)
Tested on Apple Silicon 24 GB+. Dev run on M4 Max 64 GB.
Same as v0.1: rank 4 LoRA, lr 1e-6, batch 1, grad_accum 16, mlx-vlm. ~5M trainable params (0.077% of base). Only the data changed.
v0.2 has 1200 records (100 iAPP images × 12 prompts). For 10 of the 12 prompts (long-form OCR, doc classify, KIE), the gold answer is the base model's own output — self-distillation, to anchor the LoRA to base behavior on prompts v0.1 broke. The other 2 (short_transcribe, short_read) use iAPP ground truth.
Trained 400 iters. Auto-stop fired at 600 when document classification collapsed.
| Area | vs base |
|---|---|
| Text recognition | improved (less than v0.1) |
| Full-page OCR | recovered |
| Table parsing, KIE, KIM | preserved |
| Document classification | small regression |
299-sample stratified subset of ThaiOCRBench (seed 42), same set v0.1 used. DW-light = max(substring_match, ANLS) — lightweight local scoring, not the paper protocol. Neutral set is openthaigpt/thai-ocr-evaluation, n=104.
adapters.safetensors
adapter_config.json
train_manifest.jsonl
contamination_manifest_full.json
NOTICE
FROZEN.md
Apache 2.0. Built on Gemma 4 26B-A4B (Apache 2.0), iAPP Thai Handwriting Dataset (Apache 2.0), mlx-vlm. Evaluated on ThaiOCRBench and openthaigpt/thai-ocr-evaluation.
@misc{dw_khotaevl_ocr_v02_2026,
title = {DW-KhoTaeVL-OCR-Pro-26B-MLX-LoRA v0.2},
author = {Deaw},
year = {2026},
url = {https://huggingface.co/commandeaw/DW-KhoTaeVL-OCR-Pro-26B-MLX-LoRA-v0.2}
}