Spaces:
Running on Zero
Running on Zero
A newer version of the Gradio SDK is available: 6.13.0
metadata
title: LightOnOCR 1B Demo
emoji: π
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.42.0
app_file: app_space.py
pinned: false
license: other
LightOnOCR-1B Demo
High-performance OCR application using LightOnOCR-1B model, optimized for Apple Silicon and ZeroGPU.
π Performance
- GGUF Backend: ~3-4 seconds per page (M3 Max)!
- PyTorch Backend: ~40 seconds per page
Features
- π PDF and image support
- π Seamless switching between GGUF and PyTorch backends (Local)
- ποΈ Configurable resolution (scale) and token generation
- π₯οΈ CLI and Gradio web interface
- π Full Metal/MPS support
Quick Start (Local)
1. Prerequisites
- Python 3.10+
cmakeandgit
pip install -r requirements.txt
pip install accelerate
2. Setup GGUF (Highly Recommended)
See GGUF Setup Guide.
- Build
llama.cpplocally:git clone https://github.com/ggerganov/llama.cpp cd llama.cpp && mkdir build && cd build cmake .. -DGGML_METAL=ON && cmake --build . --config Release -j 8 cd ../.. - Download model:
python download_gguf_model.py
3. Usage
Command Line:
# Fastest
python ocr_cli.py document.pdf --backend gguf
# High Quality
python ocr_cli.py document.pdf --backend gguf --scale 2.0
Web Interface:
python app.py
Open http://127.0.0.1:7860 and select GGUF backend.