1

Gliese-OCR-7B-Post2.0-final-FP8

Gliese-OCR-7B-Post2.0-final-FP8 is an FP8-compressed variant built on top of prithivMLmods/Gliese-OCR-7B-Post2.0-final. This edition applies BF16 · FP8 (F8_E4M3) precision formats to reduce memory footprint and increase inference throughput, while preserving the document understanding and structured extraction strengths of the original 7B architecture. The base Gliese-OCR-7B-Post2.0-final model is a refined and optimized evolution of Gliese-OCR-7B-Post1.0, built upon the Qwen2.5-VL architecture. It represents the final iteration in the Gliese-OCR series, offering improved efficiency, higher extraction precision, and enhanced visualization capabilities for document OCR, visual analysis, and structured information extraction.

FP8 (8-bit floating point) weight and activation quantization using hardware acceleration on GPUs – FP8 W8A8. Quantization W8A8 FP8-dynamic recipe – examples.

Key Highlights

  • BF16 · FP8 (F8_E4M3) Compression: Transformer Engine based FP8 quantization reduces VRAM usage while maintaining OCR and extraction fidelity.
  • Post2.0 Final Optimization: Incorporates refined decoding strategies, layout awareness, and structured output alignment.
  • 7B Vision-Language Backbone: Balanced performance for document intelligence tasks without the overhead of larger parameter scales.
  • Advanced OCR Capabilities: Accurate text recognition across printed, scanned, structured, and semi-structured documents.
  • Structured Information Extraction: Supports tabular parsing, form extraction, metadata detection, and layout-sensitive reasoning.
  • Dynamic Resolution Handling: Efficiently processes varying page sizes, aspect ratios, and multi-column layouts.
  • Optimized Deployment: FP8 compression enables smoother inference on Hopper and other compatible GPU architectures.

Quick Start with Transformers

from transformers import Qwen2_5_VLForConditionalGeneration, AutoProcessor
from qwen_vl_utils import process_vision_info
import torch

# Load the Gliese OCR 7B FP8 model
model = Qwen2_5_VLForConditionalGeneration.from_pretrained(
    "prithivMLmods/Gliese-OCR-7B-Post2.0-final-FP8",
    torch_dtype="auto",
    device_map="auto"
)

processor = AutoProcessor.from_pretrained(
    "prithivMLmods/Gliese-OCR-7B-Post2.0-final-FP8"
)

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "document_sample.png",
            },
            {
                "type": "text",
                "text": "Extract all readable text and return structured JSON with detected sections."
            },
        ],
    }
]

text = processor.apply_chat_template(
    messages, tokenize=False, add_generation_prompt=True
)

image_inputs, video_inputs = process_vision_info(messages)

inputs = processor(
    text=[text],
    images=image_inputs,
    videos=video_inputs,
    padding=True,
    return_tensors="pt",
).to("cuda")

generated_ids = model.generate(**inputs, max_new_tokens=1024)

generated_ids_trimmed = [
    out_ids[len(in_ids):] for in_ids, out_ids in zip(inputs.input_ids, generated_ids)
]

output_text = processor.batch_decode(
    generated_ids_trimmed,
    skip_special_tokens=True,
    clean_up_tokenization_spaces=False
)

print(output_text)

Intended Use

  • Document OCR Pipelines: Automated digitization of scanned documents and PDFs.
  • Form and Invoice Processing: Structured data extraction from financial and administrative documents.
  • Archival Digitization Projects: Converting historical records into machine-readable formats.
  • Research and Data Mining: Extracting metadata and structured information from visual documents.
  • Enterprise Document Intelligence: Layout-aware parsing and automated indexing workflows.

Limitations & Risks

Critical Note: This model focuses on OCR and structured extraction tasks.

  • Complex Handwriting Sensitivity: Performance may degrade on highly cursive or low-quality handwritten inputs.
  • Layout Variability: Extremely unconventional document layouts may require prompt refinement.
  • Hardware Requirements: FP8 acceleration requires compatible GPU support for optimal performance.
  • Responsible Use: Ensure compliance with privacy, legal, and data protection regulations when processing sensitive documents.
Downloads last month
-
Safetensors
Model size
8B params
Tensor type
BF16
·
F8_E4M3
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for prithivMLmods/Gliese-OCR-7B-Post2.0-final-FP8

Collection including prithivMLmods/Gliese-OCR-7B-Post2.0-final-FP8