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)

Provenance and EU AI Act Art. 53 note

  • Upstream model: fhswf/TrOCR_Math_handwritten โ€” published by fhswf.
  • Upstream licence: afl-3.0. This repository redistributes under the same terms; it grants no rights the upstream licence does not.
  • What was done here: format conversion and/or quantisation only (GGUF). No training, no fine-tuning, no merging, no distillation, no change to architecture, vocabulary or capability. Only the numeric representation of the upstream weights differs.
  • Training data: documented โ€” where it is documented at all โ€” by the upstream provider; see the upstream model card. No training data was used, added or selected by this repository.
  • Provider status: under Regulation (EU) 2024/1689 the upstream authors remain the provider of this model. Converting the serialisation format does not make this repository the provider of a new general-purpose AI model, and no such claim is made. Questions about training content, copyright policy or model capability belong upstream.
Downloads last month
123
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