Llama 3.1 8B OCR Post-Processor
Published by @cleanocr_dev · Community adapter
Corrects Tesseract and AWS Textract OCR errors: confused ligatures, broken hyphenation, garbled table cells, and header/footer bleed. Trained on synthetic corrupted document pairs.
Usage
from peft import PeftModel
from transformers import AutoModelForCausalLM, AutoTokenizer
tokenizer = AutoTokenizer.from_pretrained("meta-llama/Meta-Llama-3.1-8B-Instruct")
base = AutoModelForCausalLM.from_pretrained("meta-llama/Meta-Llama-3.1-8B-Instruct")
model = PeftModel.from_pretrained(base, "modelforgelab/llama31-8b-ocr-corrector-lora")
inputs = tokenizer("Your prompt here", return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Compatibility
- transformers>=4.43
- vLLM
You might also like
text-generation
public
Llama 3.1 8B Creative Writing
meta-llama/Meta-Llama-3.1-8B-Instruct
text-generation
public
Llama 3.1 8B Travel Planner
meta-llama/Meta-Llama-3.1-8B-Instruct
text-generation
public
Llama 3.1 8B Crypto Market Analyst
meta-llama/Meta-Llama-3.1-8B-Instruct
text-generation
public
Llama 3.1 8B Changelog Writer v2
meta-llama/Meta-Llama-3.1-8B-Instruct