Sync from GitHub via hub-sync
Browse filesFiles changed (2)
5 unmodified lines678910111258 unmodified lines717273747576775 unmodified lines# ]## [tool.hf-jobs]# image = "vllm/vllm-openai:latest"# flavor = "a10g-small"# secrets = ["HF_TOKEN"]# ///58 unmodified lines# Throughput receipt (a10g-small): 0.955 img/s at 1k pages incl. streaming.SERVING = {"model": "lightonai/LightOnOCR-2-1B","image": "vllm/vllm-openai:latest","max_model_len": 8192,"serve_args": ["--limit-mm-per-prompt", '{"image": 1}',5 unmodified lines678910111258 unmodified lines717273747576775 unmodified lines# ]## [tool.hf-jobs]# image = "vllm/vllm-openai:v0.22.1"# flavor = "a10g-small"# secrets = ["HF_TOKEN"]# ///58 unmodified lines# Throughput receipt (a10g-small): 0.955 img/s at 1k pages incl. streaming.SERVING = {"model": "lightonai/LightOnOCR-2-1B","image": "vllm/vllm-openai:v0.22.1","max_model_len": 8192,"serve_args": ["--limit-mm-per-prompt", '{"image": 1}',
3 unmodified lines45678910111213143 unmodified lines18192021222324257 unmodified lines33343536373839490 unmodified lines5305315325335345355365373 unmodified lines# "datasets>=4.0.0",# "huggingface-hub",# "pillow",# "vllm>=0.15.1",# "tqdm",# "toolz",# "torch",# ]# ///"""3 unmodified linesCombines Pixtral ViT encoder with Qwen3 language model for efficient document parsing.Uses Reinforcement Learning with Verifiable Rewards (RLVR) for improved quality.NOTE: Requires vLLM nightly wheels for LightOnOCR-2 support. First run may takea few minutes to download and install dependencies.Features:- ⚡ Fastest: 42.8 pages/sec on H100 GPU (7× faster than v1)7 unmodified lines- 💪 Production-ready: Outperforms models 9× largerModel: lightonai/LightOnOCR-2-1BvLLM: Requires vLLM nightly buildPerformance: 83.2 ± 0.9% on OlmOCR-Bench"""490 unmodified linesprint("\n4. Original image size (no resize):")print(" uv run lighton-ocr2.py docs output --no-resize")print("\n5. Running on HF Jobs:")print(" hf jobs uv run --flavor l4x1 \\")print(" -s HF_TOKEN \\")print(" https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr2.py \\")3 unmodified lines456789101112131415161718193 unmodified lines232425262728293031323334353637387 unmodified lines46474849505152490 unmodified lines5435445455465475485495503 unmodified lines# "datasets>=4.0.0",# "huggingface-hub",# "pillow",# "tqdm",# "toolz",# ]## [tool.hf-jobs]# image = "vllm/vllm-openai:v0.22.1"# python = "/usr/bin/python3"# env = { PYTHONPATH = "/usr/local/lib/python3.12/dist-packages" }# flavor = "a10g-small"# secrets = ["HF_TOKEN"]# ///"""3 unmodified linesCombines Pixtral ViT encoder with Qwen3 language model for efficient document parsing.Uses Reinforcement Learning with Verifiable Rewards (RLVR) for improved quality.Run on HF Jobs. vLLM and torch come from the vllm/vllm-openai:v0.22.1 image declaredin the [tool.hf-jobs] header (`hf` CLI 1.32+), which also sets the hardware and theHF_TOKEN secret. The tag is pinned: unpinned vLLM 0.29/0.30 with current transformersfails to import LightOnOCR-2 (PixtralRotaryEmbedding). Pass --timeout for a long run:hf jobs uv run --timeout 1h \\https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr2.py \\<input-dataset> <output-dataset>To run on your own GPU, add the engine: `uv run --with vllm==0.22.1 lighton-ocr2.py ...`.Features:- ⚡ Fastest: 42.8 pages/sec on H100 GPU (7× faster than v1)7 unmodified lines- 💪 Production-ready: Outperforms models 9× largerModel: lightonai/LightOnOCR-2-1BvLLM: vllm/vllm-openai:v0.22.1 image (see the header)Performance: 83.2 ± 0.9% on OlmOCR-Bench"""490 unmodified linesprint("\n4. Original image size (no resize):")print(" uv run lighton-ocr2.py docs output --no-resize")print("\n5. Running on HF Jobs:")print(" (image, hardware and HF_TOKEN come from the script's [tool.hf-jobs] header)")print(" hf jobs uv run \\")print(" https://huggingface.co/datasets/uv-scripts/ocr/raw/main/lighton-ocr2.py \\")
lighton-ocr2-saturate.py+2-2
lighton-ocr2.py+20-7