How to use from the
Use from the
llama-cpp-python library
# !pip install llama-cpp-python

from llama_cpp import Llama

llm = Llama.from_pretrained(
	repo_id="kiel2/KielLens-ocr",
	filename="KielLens-ocr-Q4_K_M.gguf",
)
llm.create_chat_completion(
	messages = [
		{
			"role": "user",
			"content": [
				{
					"type": "text",
					"text": "Describe this image in one sentence."
				},
				{
					"type": "image_url",
					"image_url": {
						"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
					}
				}
			]
		}
	]
)

KielLens-ocr

KielLens-ocr is a fine-tuned Vision-Language Model (VLM) designed for high-precision document parsing, multi-lingual OCR, table extraction, and complex visual reasoning. It is built by fine-tuning the powerhouse vision architecture Qwen/Qwen2.5-VL-3B-Instruct using low-rank adapters (LoRA) via Hugging Face's TRL framework.

Model Details

  • Developed by: kielTech
  • Model Type: Vision-Language Model (OCR & Document AI)
  • Base Model: Qwen/Qwen2.5-VL-3B-Instruct
  • Language(s): Multi-lingual (English, supported Qwen languages)
  • License: Apache 2.0
  • Fine-tuning Method: Parameter-Efficient Fine-Tuning (PEFT) / LoRA

Intended Uses & Limitations

Intended Uses

  • Automated text extraction from structured and unstructured documents (PDF screenshots, receipts, forms).
  • Handling and reading messy or handwritten text.
  • Table understanding and structural key-value pair extractions.

Limitations

  • The model inherits the native constraints of the Qwen2.5-VL architecture.
  • Performance on highly dense technical schematics or low-resolution text depends heavily on the input resolution configured during inference.

Training Hyperparameters (TRL Configuration)

The following configurations were leveraged during the parameter-efficient SFT training phase:

  • Quantization: 4-bit NormalFloat (NF4) with double quantization active.
  • Learning Rate: 2e-4
  • Optimizer: paged_adamw_32bit
  • Target Modules: Vision attention layers (q_proj, v_proj)
  • Precision: Mixed precision (fp16/bf16 depending on hardware fallback)

How to Load and Use

You can load the adapters directly on top of the base model using the transformers library:

import torch
from transformers import AutoProcessor, AutoModelForCausalLM

model_id = "Qwen/Qwen2.5-VL-3B-Instruct"
adapter_id = "kiel2/KielLens-ocr"

# Load the base model with the custom fine-tuned adapters
model = AutoModelForCausalLM.from_pretrained(
    model_id,
    quantization_config=None, # Update with BitsAndBytesConfig if running on limited VRAM
    device_map="auto",
    torch_dtype=torch.float16
)
model.load_adapter(adapter_id)

processor = AutoProcessor.from_pretrained(model_id)
Downloads last month
-
GGUF
Model size
3B params
Architecture
qwen2vl
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for kiel2/KielLens-ocr

Adapter
(239)
this model