GLM-OCR Bulgarian — LoRA adapter

LoRA adapter fine-tuned on the Bulgarian State Gazette (Държавен вестник) on top of zai-org/GLM-OCR. Apply this adapter to the base model for Bulgarian-Cyrillic OCR.

The merged drop-in version is at whodatbo1/glm-ocr-bulgarian — use that if you don't want to deal with PEFT at inference time.

Use (with PEFT)

from peft import PeftModel
from transformers import AutoModel, AutoProcessor

base = AutoModel.from_pretrained(
    "zai-org/GLM-OCR", trust_remote_code=True, torch_dtype="bfloat16"
)
model = PeftModel.from_pretrained(base, "whodatbo1/glm-ocr-bulgarian-lora")
processor = AutoProcessor.from_pretrained(
    "zai-org/GLM-OCR", trust_remote_code=True
)

The training prompt is the GLM-OCR canonical Text Recognition: — prepend <image> and use the same prompt at inference.

Training data

whodatbo1/bulgarian-state-gazette-ocr — 200-DPI page renders paired with raw PyMuPDF text extractions across 2000–2026 issues (~3 K issues, ~110 K pages after filters). Built by build_ocr_dataset.py from the legislature_differ project.

Training recipe

LlamaFactory sft + lora (rank 16, α 32, all linear modules) on a single A100 / H100. Effective batch size 8, lr 1e-4, cosine, 3 epochs, bf16 + flash-attn 2. See ocr-finetune/llamafactory_train.yaml in the source repo.

Citation

Source content is in the public domain (Bulgarian official gazette). This adapter is released under MIT.

Downloads last month
5
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for whodatbo1/glm-ocr-bulgarian-lora

Base model

zai-org/GLM-OCR
Adapter
(12)
this model