Views
No views yet
| Base model | OvisOCR2 (Qwen3.5-VL arch, Qwen3_5ForConditionalGeneration, ~0.8B params) |
| Quantization | Affine int8 (uniform 8-bit, group size 64) |
| Bits per weight | 9.389 |
| Disk size | 980 MB (from ~1.6 GB bf16) |
| Format | MLX (safetensors) |
1from mlx_vlm import load, generate
2from mlx_vlm.prompt_utils import apply_chat_template
3from mlx_vlm.utils import load_config
4
5model_path = "sahilchachra/ovisocr2-int8-mlx"
6model, processor = load(model_path, trust_remote_code=True)
7config = load_config(model_path, trust_remote_code=True)
8
9prompt = (
10 "\nExtract all readable content from the image in natural human reading order "
11 "and output the result as a single Markdown document. For charts or images, "
12 'represent them using an HTML image tag: <img src="images/bbox_{left}_{top}_{right}_{bottom}.jpg" />, '
13 "where left, top, right, bottom are bounding box coordinates scaled to [0, 1000). "
14 "Format formulas as LaTeX. Format tables as HTML: <table>...</table>. Transcribe all "
15 "other text as standard Markdown. Preserve the original text without translation or paraphrasing."
16)
17formatted = apply_chat_template(processor, config, prompt, num_images=1, enable_thinking=False)
18out = generate(model, processor, formatted, image="page.png", max_tokens=2048, verbose=False)
19print(out.text if hasattr(out, "text") else out)1mlx_vlm.generate --model sahilchachra/ovisocr2-int8-mlx \
2 --prompt "Extract all readable content from the image as Markdown." \
3 --image page.png --max-tokens 2048mlx_vlm.generate, greedy, max_tokens=2048), and outputs were compared against ground
truth with two metrics: character-level similarity (difflib.SequenceMatcher) and word
recall (fraction of ground-truth words present in the output).| Variant | Bits/weight | Disk size | Mean similarity | Mean word recall | Degenerate outputs | Agreement with FP16 | Eval time (15 pages) |
|---|---|---|---|---|---|---|---|
| fp16 | 16 | 1.6 GB | 63.4% | 92.9% | 0/15 | — | 212.4s |
| mxfp4 | 5.643 | 599 MB | 63.2% | 93.1% | 0/15 | 96.5% | 138.1s |
| int4 | 5.863 | 622 MB | 63.5% | 93.2% | 0/15 | 96.1% | 140.7s |
| mxfp8 | 9.168 | 958 MB | 63.0% | 92.9% | 0/15 | 97.7% | 166.8s |
| int8 | 9.389 | 980 MB | 63.9% | 93.1% | 0/15 | 99.2% | 165.1s |
$...$ compact
math, ground truth uses spaced $ ... $ with \left\{/\right\}) even when the
transcribed content is correct. Spot-checking the lowest-similarity page (an academic-paper
equation block, sim≈3%) confirmed the model's output was in fact a faithful, correctly
ordered transcription — the metric penalizes LaTeX style, not content.