Instructions to use whodatbo1/glm-ocr-bulgarian-lora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use whodatbo1/glm-ocr-bulgarian-lora with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("zai-org/GLM-OCR") model = PeftModel.from_pretrained(base_model, "whodatbo1/glm-ocr-bulgarian-lora") - Notebooks
- Google Colab
- Kaggle
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
Model tree for whodatbo1/glm-ocr-bulgarian-lora
Base model
zai-org/GLM-OCR