Views
No views yet
| Property | Value |
|---|---|
| Architecture | SAM-ViT encoder + MBart Transformer decoder |
| Parameters | 181M |
| Input | 768x768 RGB image |
| Output | LaTeX token sequence |
| Vocab | 50,000 tokens (NougatTokenizer / BPE) |
| License | Apache-2.0 |
| Property | Value |
|---|---|
| Type | SAM ViT-B (from PaddleOCR Vary_VIT_B_Formula) |
| Layers | 12 |
| Hidden dim | 768 |
| Heads | 12 |
| MLP dim | 3072 |
| Patch size | 16x16 (48x48 patches) |
| Attention | Windowed (ws=14) on layers 0,1,3,4,6,7,9,10; Global on layers 2,5,8,11 |
| Position bias | Decomposed relative position (per-axis, interpolated) |
| Neck | Conv1x1 + LayerNorm2d + Conv3x3 + LayerNorm2d (768 -> 256) |
| Projector | 2x Conv3x3(stride=2) + 2x Linear (256 -> 512). Output: 144 tokens x 512d |
| Property | Value |
|---|---|
| Layers | 8 |
| Heads | 16 |
| d_model | 512 |
| FFN dim | 2048 |
| Activation | GELU |
| Embedding | scale_embedding = sqrt(512) |
| Max length | 1024 tokens |
| File | Quant | Size | Encoder cos vs F32 | Notes |
|---|---|---|---|---|
ppformulanet-l-f16.gguf | FP16 | 347 MB | baseline | Full precision |
ppformulanet-l-q8_0.gguf | Q8_0 | 241 MB | 0.999940 | Critical tensors in F16 |
ppformulanet-l-q4_k.gguf | Q4_K | 122 MB | 0.997595 | Desktop/mobile target |
ppformulanet-l-q8_0.gguf (241 MB) — near-lossless quality at 1.4x compression vs F16.ppformulanet-l-q4_k.gguf (122 MB) — good quality at 2.8x compression.crispembed-quantize tool (K-quant with importance-weighted groups). LayerNorm and biases stay in F16; large matrices go to Q4_K.1# CLI — auto-detected from GGUF metadata
2crispembed -m ppformulanet-l-q8_0.gguf --ocr formula.png
3
4# Output: LaTeX string
5# \zeta_{0}(\nu) = -\frac{\nu\varrho^{-2\nu}}{\pi} ...1#include "crispembed.h"
2
3void *ctx = crispembed_math_ocr_init("ppformulanet-l-q8_0.gguf", 4);
4int len;
5const char *latex = crispembed_math_ocr_recognize(ctx, pixels, w, h, channels, &len);
6printf("%s\n", latex);
7crispembed_math_ocr_free(ctx);general.architecture = "ppformulanet_l" from GGUF metadata.PPFormulaNetForConditionalGeneration reference:| Metric | F32 | Q8_0 | Q4_K |
|---|---|---|---|
| Encoder cosine similarity | 0.999962 | 0.999940 | 0.997595 |
| Top-1 token match | Yes | Yes | Yes |
| Full decode match | Yes | Yes | Yes |
1# F16
2python models/convert-ppformulanet-l-to-gguf.py \
3 --model-dir PP-FormulaNet-L --output ppformulanet-l-f16.gguf --fp16
4
5# Q8_0 (critical tensors in F16)
6python models/convert-ppformulanet-l-to-gguf.py \
7 --model-dir PP-FormulaNet-L --output ppformulanet-l-q8_0.gguf --q8_0
8
9# Q4_K (from F16 via C quantizer)
10crispembed-quantize ppformulanet-l-f16.gguf ppformulanet-l-q4_k.gguf q4_kPaddlePaddle.apache-2.0. This repository redistributes under the same terms; it grants no rights the upstream licence does not.