Image-Text-to-Text
MLX
Safetensors
Japanese
English
Chinese
unlimited-ocr
ocr
document-parsing
japanese
quantized
conversational
custom_code
4-bit precision
Instructions to use tokimoa/unlimited-ocr-mlx-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use tokimoa/unlimited-ocr-mlx-4bit 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("tokimoa/unlimited-ocr-mlx-4bit") config = load_config("tokimoa/unlimited-ocr-mlx-4bit") # 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
Unlimited-OCR (MLX 4bit, verified)
Baiduの Unlimited-OCR(3.3B・DeepSeek-V2系MoE+MLA+deepencoder構成のドキュメントパースモデル)を、公式重みからMLX 4bit(group size 64、実効5.88bpw)に量子化したものです。日本語ビジネス文書での検証済みで公開しています。
ページ画像から、レイアウト検出ボックス(<|det|>種別 [x1,y1,x2,y2]<|/det|>)付きで読み順どおりのテキスト(表はHTML)を出力します。
なぜ公開するか
公開時点で存在した本モデルの既存MLX変換を同一プロトコルで検証したところ、現行mlx-vlmでロードできないもの(model_type改名)や、トークナイザ不整合により出力がbyte-BPE片のまま文字化けするものを確認しました。本リポジトリは公式重みから変換し、下記の検証を通した上で公開しています。
変換品質の検証(tokimoa)
日本語ビジネス文書5種(請求書・議事録・契約条項・チェックシート・英日混在技術文書、正解文字列59項目)で検証:
- テキスト内容がbf16版と4/5画像で一致。唯一の差分は記号1箇所(bf16が「X」とした×記号を4bitは「×」と正しく出力)
- 正解文字列カバレッジ 58/59・検出ボックス座標の差は±数px
- 同一入力の反復で出力完全一致(決定論的)
実測速度(M4 Max 36GB)
- 生成: 368 tok/s / ピークメモリ: 5.9GB(MoEのアクティブパラメータが小さいため高速)
使い方
チャットテンプレートではなく、素のプロンプトに <image> トークンを含める形式です:
# pip install mlx-vlm (0.6.7で動作確認)
from mlx_vlm import load, generate
model, processor = load("tokimoa/unlimited-ocr-mlx-4bit")
out = generate(model, processor, "<image>document parsing.",
image=["page.png"], max_tokens=4096, temperature=0.0)
print(out.text)
複数ページは "<image>Multi page parsing."(上流README準拠)。
変換情報
- 変換元:
baidu/Unlimited-OCR(公式重み) - 変換:
mlx-vlm 0.6.7convert-q --q-bits 4(2.4GB) - 変換者: tokimoa
ライセンス
MIT(元モデルに準拠)
- Downloads last month
- 56
Model size
0.9B params
Tensor type
BF16
·
U32 ·
Hardware compatibility
Log In to add your hardware
4-bit
Model tree for tokimoa/unlimited-ocr-mlx-4bit
Base model
baidu/Unlimited-OCR