davanstrien HF Staff Claude commited on
Commit
a77e763
Β·
1 Parent(s): d805bea

Add LightOnOCR documentation to README

Browse files

Add LightOnOCR as first script in README with recommendation to test
first since it's small and fast.

Features highlighted:
- Fastest OCR option (5.71 pages/sec on H100, 6.25 images/sec on A100)
- Compact 1B parameters for quick downloads
- 3 vocabulary sizes (151k/32k/16k) with European language optimization
- LaTeX formulas and table extraction
- Production-ready with 76.1% benchmark score

Includes quick start examples:
- L4 test run with 100 samples
- A100 production run with batch_size=4096

Positioning LightOnOCR as the recommended starting point for users
new to the OCR scripts due to fast initialization and excellent
speed/quality balance.

πŸ€– Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>

Files changed (1) hide show
  1. README.md +38 -0
README.md CHANGED
@@ -31,6 +31,44 @@ That's it! The script will:
31
 
32
  ## πŸ“‹ Available Scripts
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  ### DeepSeek-OCR (`deepseek-ocr-vllm.py`) ⭐ NEW
35
 
36
  Advanced document OCR using [deepseek-ai/DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) with visual-text compression:
 
31
 
32
  ## πŸ“‹ Available Scripts
33
 
34
+ ### LightOnOCR (`lighton-ocr.py`) ⚑ Good one to test first since it's small and fast!
35
+
36
+ Fast and compact OCR using [lightonai/LightOnOCR-1B-1025](https://huggingface.co/lightonai/LightOnOCR-1B-1025):
37
+
38
+ - ⚑ **Fastest**: 5.71 pages/sec on H100, ~6.25 images/sec on A100 with batch_size=4096
39
+ - 🎯 **Compact**: Only 1B parameters - quick to download and initialize
40
+ - 🌍 **Multilingual**: 3 vocabulary sizes for different use cases
41
+ - πŸ“ **LaTeX formulas**: Mathematical notation in LaTeX format
42
+ - πŸ“Š **Table extraction**: Markdown table format
43
+ - πŸ“ **Document structure**: Preserves hierarchy and layout
44
+ - πŸš€ **Production-ready**: 76.1% benchmark score, used in production
45
+
46
+ **Vocabulary sizes:**
47
+ - `151k`: Full vocabulary, all languages (default)
48
+ - `32k`: European languages, ~12% faster decoding
49
+ - `16k`: European languages, ~12% faster decoding
50
+
51
+ **Quick start:**
52
+ ```bash
53
+ # Test on 100 samples with English text (32k vocab is fastest for European languages)
54
+ hf jobs uv run --flavor l4x1 \
55
+ -s HF_TOKEN \
56
+ https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr.py \
57
+ your-input-dataset your-output-dataset \
58
+ --vocab-size 32k \
59
+ --batch-size 32 \
60
+ --max-samples 100
61
+
62
+ # Full production run on A100 (can handle huge batches!)
63
+ hf jobs uv run --flavor a100-large \
64
+ -s HF_TOKEN \
65
+ https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr.py \
66
+ your-input-dataset your-output-dataset \
67
+ --vocab-size 32k \
68
+ --batch-size 4096 \
69
+ --temperature 0.0
70
+ ```
71
+
72
  ### DeepSeek-OCR (`deepseek-ocr-vllm.py`) ⭐ NEW
73
 
74
  Advanced document OCR using [deepseek-ai/DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) with visual-text compression: