Nyansapo Ocr Trocr LoRA v1
Fine-tuned OCR model by Nyansapo built on microsoft/trocr-base-handwritten with LoRA adapters on the decoder.
Model source
- Kind
- LoRA
- File size
- 19.2 MB
- Base model
- microsoft/trocr-base-handwritten
- Version
- vadapter_model
- Updated
- Sep 18, 2026
- Downloads
- 3
- Source
- Hugging Face
Source description
Nyansapo OCR — TrOCR LoRA v1
Fine-tuned OCR model by Nyansapo built on microsoft/trocr-base-handwritten
with LoRA adapters on the decoder.
Training details
- Base model: microsoft/trocr-base-handwritten
- PEFT: LoRA (r=16, alpha=32)
- Targets: q_proj, k_proj, v_proj, out_proj, fc1, fc2
- Dataset: Nzyoka19/ocr_images
Inference
from transformers import VisionEncoderDecoderModel, TrOCRProcessor
from peft import PeftModel
from PIL import Image
base = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-base-handwritten')
processor = TrOCRProcessor.from_pretrained('Nzyoka19/nyansapo-ocr-trocr-lora_v1')
base.decoder = PeftModel.from_pretrained(base.decoder, 'Nzyoka19/nyansapo-ocr-trocr-lora_v1')
base.eval()
image = Image.open('image.png').convert('RGB')
pixel_values = processor(images=image, return_tensors='pt').pixel_values
ids = base.generate(pixel_values)
print(processor.batch_decode(ids, skip_special_tokens=True)[0])
Sources
1 source
Sources
1 sourceVerified Sep 3
Model artifacts
1 artifact
Model artifacts
1 artifactadapter_model.safetensors
safetensors · 19.2 MB · SHA-256 e8bb8f347933…97b6 · Hugging Face
Download fileSource excerpts
2 excerpts
Source excerpts
2 excerpts--- base_model: microsoft/trocr-base-handwritten tags: - ocr - lora - peft - trocr - image-to-text - nyansapo license: mit language: - en --- # Nyansapo OCR — TrOCR LoRA v1 Fine-tuned OCR model by **Nyansapo** built on `microsoft/trocr-base-handwritten` with LoRA adapters on the decoder. ## Training details - **Base model:** microsoft/trocr-base-handwritten - **PEFT:** LoRA (r=16, alpha=32) - **Targets:** q_proj, k_proj, v_proj, out_proj, fc1, fc2 - **Dataset:** Nzyoka19/ocr_images ## Inference ```python from transformers import VisionEncoderDecoderModel, TrOCRProcessor from peft import PeftModel from PIL import Image base = VisionEncoderDecoderModel.from_pretrained('microsoft/trocr-base-handwritten') processor = TrOCRProcessor.from_pretrained('Nzyoka19/nyansapo-ocr-trocr-lora_v1') base.decoder = PeftModel.from_pretrained(base.decoder, 'Nzyoka19/nyansapo-ocr-trocr-lora_v1') base.eval() image = Image.open('image.png').convert('RGB') pixel_values = processor(images=image, return_tensors='pt').pixel_values ids = base.generate(pixel_values) print(processor.batch_decode(ids, skip_special_tokens=True)[0]) ```
Source context: 3 downloads · 0 likes · Pipeline image-to-text · Library peft · Repo Nzyoka19/nyansapo-ocr-trocr-lora_v1
