Downloads · 30 days
64
30% of all-time downloads
mlx-community/GOT-OCR2_0-bf16
GOT-OCR2_0-bf16 is a image-text-to-text model from mlx-community. 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. The card lists the license as apache-2.0.
bf16 MLX conversion of stepfun-ai/GOT-OCR20, the 560M-parameter OCR-2.0 model. Converted with mlx-vlm 0.6.14 (mlx 0.32.0) for inference on Apple Silicon.
Downloads · 30 days
64
30% of all-time downloads
All-time downloads
216
Public
Parameters
561M
1.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.1 GB · 100%
From the Hugging Face model README
bf16 MLX conversion of stepfun-ai/GOT-OCR2_0, the 560M-parameter
OCR-2.0 model. Converted with mlx-vlm 0.6.14 (mlx 0.32.0) for inference on
Apple Silicon.
Fidelity was measured against the unquantized bf16 source and against the reference PyTorch implementation, not assumed. Every number below comes from a run recorded in this card.
Requires
mlx-vlmwith GOT-OCR 2.0 support, which is currently open as Blaizzy/mlx-vlm#1908. The PR is not merged yet, so a releasedmlx-vlmcannot load this repo.
python -m mlx_vlm generate \
--model mlx-community/GOT-OCR2_0-bf16 \
--image document.png \
--prompt "OCR: " \
--max-tokens 1024
GOT is not a chat model. It takes two instructions: OCR: for plain text and
OCR with format: for structured output (tables, formulas, sheet music). Any
other prompt is out of distribution.
| Precision | bfloat16 |
| Bits/weight | 16.0 |
| Size on disk | 1.12 GB |
| Parameters | 560.5M (716.0M stored, tied lm_head dropped) |
No quantization. This is the reference the two quantized variants were measured against, and the one to use when fidelity matters more than memory.
One forward pass, same image and same prompt (the MPT conversation the model was trained with), comparing the final-position logits over all 151,860 classes.
| Comparison | max abs error | cosine | argmax |
|---|---|---|---|
| MLX bf16 vs torch fp32 | 0.47469 | 0.99979109 | same, top-5 identical |
| MLX fp32 vs torch fp32 | 0.000130 | 1.0000000000 | same |
The second row is the one that matters: the source weights are bf16, so running the MLX port in fp32 loses nothing, and the residual is porting error alone. The first row's larger figure is bf16 rounding, not a defect.
Six documents rendered locally with exactly known text (invoice, lab report,
shipping label, receipt, spec table, rotated receipt), transcribed with OCR:
and scored directly. This sidesteps using bf16 as the reference at all.
| Variant | field | content | numeric | CER vs bf16 | tok/s | peak GB |
|---|---|---|---|---|---|---|
| bf16 | 0.8684 | 0.9605 | 0.9720 | 0 (ref) | 138.3 | 2.50 |
| 8-bit | 0.8684 | 0.9605 | 0.9720 | 0.0000 | 210.8 | 2.06 |
| 4-bit | 0.8947 | 0.9474 | 0.9623 | 0.0116 | 272.9 | 1.83 |
field counts required strings present exactly, content ignores markup and
whitespace, numeric counts ground-truth numbers recovered.
The 8-bit output is byte-identical to bf16 on all six documents, down to the same fields missed.
Two caveats a reader should have:
field score is higher than bf16 and that is not an improvement.
The denominator is 38 strings, so one string is 0.026. 4-bit happens to get the
invoice fully right and then loses 12.00 on the receipt. content and
numeric, which are less format-sensitive, both move the other way. Treat the
three variants as separated by one or two strings, not by field.shipping_label loses the same three fields in every variant, bf16
included (1Z-994-AX-77310582, Halberd Components, 3011AB). That is a
limit of the source model on that document, not a quantization effect.Throughput measured on an M-series Mac during the same run, single image, generation only.
OCR with format: was not scored. The accuracy table uses OCR: only.
Format mode was smoke-tested and runs, but no ground-truth scoring was done for
tables, formulas or sheet music.Source model: stepfun-ai/GOT-OCR2_0 (paper).