TrOCR Math Handwritten โ€” GGUF

Handwritten math equation recognition via CrispEmbed's ggml inference engine.

Source model: fhswf/TrOCR_Math_handwritten (AFL-3.0)

Architecture: ViT-Large encoder (24L, 1024d, 16H) + TrOCR-Large decoder (12L, 1024d, 16H, vocab=50265)

Models

File Size Description
trocr-math-handwritten-fp16.gguf 1.2 GB FP16 weights
trocr-math-handwritten-q4_k.gguf 355 MB Q4_K quantized

Verified Output

Input Recognized
x+y=5 (hand-drawn) X + Y =
xยฒ+1 (printed) x^{2}
3x+7=0 (printed) 3x+7
+ (cross pattern) +

Usage with CrispEmbed

math_ocr_context* ctx = math_ocr_init("trocr-math-handwritten-q4_k.gguf", 4);
const char* latex = math_ocr_recognize(ctx, gray_pixels, width, height, &len);
math_ocr_free(ctx);

Conversion

Converted from HuggingFace safetensors using CrispEmbed's torch-free converter:

python models/convert-trocr-safetensors-to-gguf.py \
  --model-dir /path/to/fhswf/TrOCR_Math_handwritten \
  --output trocr-math-handwritten-fp16.gguf --fp16

Key converter features:

  • No PyTorch dependency (uses safetensors + gguf + numpy only)
  • Generates sinusoidal position embeddings (not stored in checkpoint)
  • Squeezes 3D batch dimensions, reshapes 4D conv weights
  • Preserves AFL-3.0 license in GGUF metadata

License

Academic Free License v3.0 (inherited from source model)

Downloads last month
94
GGUF
Model size
0.6B params
Architecture
math_ocr
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for cstr/trocr-math-handwritten-gguf

Quantized
(1)
this model