Image-Text-to-Text
MLX
Safetensors
multilingual
unlimited-ocr
ocr
vision-language
conversational
custom_code
8-bit precision
Instructions to use mlx-community/Unlimited-OCR-2-8bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use mlx-community/Unlimited-OCR-2-8bit 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("mlx-community/Unlimited-OCR-2-8bit") config = load_config("mlx-community/Unlimited-OCR-2-8bit") # 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
mlx-community/Unlimited-OCR-2-8bit
baidu/Unlimited-OCR-2 converted to MLX with
mlx-vlm: 8-bit affine quantization (group size 64) of the language model. The SAM and CLIP vision towers and the
per-layer DASH router stay in bfloat16.
Refer to the original model card for details on the model.
Use with mlx-vlm
Unlimited-OCR-2 support (page2d RoPE and DASH block-sparse attention) is being upstreamed to mlx-vlm. Until it is released, install from the branch that adds it:
pip install -U "git+https://github.com/shuuul/mlx-vlm.git"
# One page (gundam mode: 1024 global view + up to 16 local crops)
mlx_vlm.generate --model mlx-community/Unlimited-OCR-2-8bit --image page.png \
--prompt "Multi page parsing." --max-tokens 8192 --temperature 0
# Several pages in one request (one 1024 base view per page)
mlx_vlm.generate --model mlx-community/Unlimited-OCR-2-8bit --image p1.png p2.png \
--prompt "Multi page parsing." --max-tokens 16384 --temperature 0
The output uses <PAGE>, <BLOCK>label[x0, y0, x1, y1]<FORK>text and cross_* / append_*
labels for blocks that continue across a page break; the upstream repository ships a converter
to Markdown.
- Downloads last month
- -
Model size
3B params
Tensor type
BF16
·
U32 ·
Hardware compatibility
Log In to add your hardware
8-bit
Model tree for mlx-community/Unlimited-OCR-2-8bit
Base model
baidu/Unlimited-OCR-2