Sync from GitHub via hub-sync
Browse files- README.md +22 -1
- abot-ocr.py +4 -0
- deepseek-ocr-vllm.py +4 -0
- deepseek-ocr2-vllm.py +4 -0
- dots-mocr.py +4 -0
- dots-ocr.py +4 -0
- firered-ocr.py +4 -0
- glm-ocr-bucket.py +5 -0
- glm-ocr-v2.py +4 -0
- glm-ocr.py +4 -0
- hunyuan-ocr.py +4 -0
- lighton-ocr.py +4 -0
- lighton-ocr2.py +4 -0
- nanonets-ocr.py +4 -0
- nanonets-ocr2.py +4 -0
- nuextract3.py +4 -0
- numarkdown-ocr.py +4 -0
- olmocr2-vllm.py +4 -0
- paddleocr-vl-1.6.py +4 -0
- paddleocr-vl.py +4 -0
- qianfan-ocr.py +4 -0
- rolm-ocr.py +4 -0
- smoldocling-ocr.py +4 -0
README.md
CHANGED
|
@@ -60,7 +60,7 @@ _Sorted by model size:_
|
|
| 60 |
| `nanonets-ocr2.py` | [Nanonets-OCR2-3B](https://huggingface.co/nanonets/Nanonets-OCR2-s) | 3B | vLLM | Next-gen, Qwen2.5-VL base |
|
| 61 |
| `deepseek-ocr-vllm.py` | [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) | 4B | vLLM | 5 resolution + 5 prompt modes |
|
| 62 |
| `deepseek-ocr.py` | [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) | 4B | Transformers | Same model, Transformers backend |
|
| 63 |
-
| `deepseek-ocr2-vllm.py` | [DeepSeek-OCR-2](https://huggingface.co/deepseek-ai/DeepSeek-OCR-2) | 3B | vLLM | Newer
|
| 64 |
| `nuextract3.py` | [NuExtract3](https://huggingface.co/numind/NuExtract3) | 4B | vLLM | Markdown OCR **+ schema-guided JSON extraction** (template/Pydantic). Needs `vllm/vllm-openai` image |
|
| 65 |
| `qianfan-ocr.py` | [Qianfan-OCR](https://huggingface.co/baidu/Qianfan-OCR) | 4.7B | vLLM | #1 OmniDocBench v1.5 (93.12), Layout-as-Thought, 192 languages |
|
| 66 |
| `olmocr2-vllm.py` | [olmOCR-2-7B](https://huggingface.co/allenai/olmOCR-2-7B-1025-FP8) | 7B | vLLM | 82.4% olmOCR-Bench |
|
|
@@ -106,6 +106,27 @@ hf jobs uv run --flavor l4x1 -s HF_TOKEN \
|
|
| 106 |
|
| 107 |
Source/sink can be either an HF dataset repo OR an `hf://buckets/...` URL (auto-detected). Bucket output writes incremental zstd parquet shards via the buckets API — resumable across runs (snapshot-backed source listing) and no git/commit overhead. See the script's `--help` for all flags.
|
| 108 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 109 |
## Common Options
|
| 110 |
|
| 111 |
The scripts aim to expose a **consistent interface**: every OCR model script takes `input-dataset output-dataset` as positional arguments, accepts the shared core flags below, and writes a `markdown` column — so switching models is usually just swapping the script URL. Models differ where they need to, though: some add their own flags (task modes, resolution presets, `--think`, vocab sizes), a few need a specific Docker image, and per-model defaults (batch size, context length, temperature) are tuned to each model card. Always check a script's `--help` for its specifics.
|
|
|
|
| 60 |
| `nanonets-ocr2.py` | [Nanonets-OCR2-3B](https://huggingface.co/nanonets/Nanonets-OCR2-s) | 3B | vLLM | Next-gen, Qwen2.5-VL base |
|
| 61 |
| `deepseek-ocr-vllm.py` | [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) | 4B | vLLM | 5 resolution + 5 prompt modes |
|
| 62 |
| `deepseek-ocr.py` | [DeepSeek-OCR](https://huggingface.co/deepseek-ai/DeepSeek-OCR) | 4B | Transformers | Same model, Transformers backend |
|
| 63 |
+
| `deepseek-ocr2-vllm.py` | [DeepSeek-OCR-2](https://huggingface.co/deepseek-ai/DeepSeek-OCR-2) | 3B | vLLM | Newer; needs nightly vLLM **+ the `vllm/vllm-openai` image** ([why](#if-a-vllm-script-crashes-at-startup-the-nvcc--nvrtc-error)) |
|
| 64 |
| `nuextract3.py` | [NuExtract3](https://huggingface.co/numind/NuExtract3) | 4B | vLLM | Markdown OCR **+ schema-guided JSON extraction** (template/Pydantic). Needs `vllm/vllm-openai` image |
|
| 65 |
| `qianfan-ocr.py` | [Qianfan-OCR](https://huggingface.co/baidu/Qianfan-OCR) | 4.7B | vLLM | #1 OmniDocBench v1.5 (93.12), Layout-as-Thought, 192 languages |
|
| 66 |
| `olmocr2-vllm.py` | [olmOCR-2-7B](https://huggingface.co/allenai/olmOCR-2-7B-1025-FP8) | 7B | vLLM | 82.4% olmOCR-Bench |
|
|
|
|
| 106 |
|
| 107 |
Source/sink can be either an HF dataset repo OR an `hf://buckets/...` URL (auto-detected). Bucket output writes incremental zstd parquet shards via the buckets API — resumable across runs (snapshot-backed source listing) and no git/commit overhead. See the script's `--help` for all flags.
|
| 108 |
|
| 109 |
+
## If a vLLM script crashes at startup (the `nvcc` / `nvrtc` error)
|
| 110 |
+
|
| 111 |
+
The vLLM recipes run on the **default** Jobs image and carry a guard (`VLLM_USE_FLASHINFER_SAMPLER=0`) so they work there with the plain command. But some — especially nightly-vLLM ones — JIT-compile a CUDA kernel at engine init and crash on the default image with one of:
|
| 112 |
+
|
| 113 |
+
```
|
| 114 |
+
RuntimeError: Could not find nvcc and default cuda_home='/usr/local/cuda' doesn't exist
|
| 115 |
+
nvrtc: error: failed to open libnvrtc-builtins.so...
|
| 116 |
+
```
|
| 117 |
+
|
| 118 |
+
Run those on the **`vllm/vllm-openai` image**, which ships the full CUDA toolkit. Add these flags to any recipe — they point `import vllm` at the image's CUDA-matched build:
|
| 119 |
+
|
| 120 |
+
```bash
|
| 121 |
+
hf jobs uv run --flavor l4x1 --secrets HF_TOKEN \
|
| 122 |
+
--image vllm/vllm-openai --python /usr/bin/python3 \
|
| 123 |
+
-e PYTHONPATH=/usr/local/lib/python3.12/dist-packages \
|
| 124 |
+
https://huggingface.co/datasets/uv-scripts/ocr/raw/main/<script>.py \
|
| 125 |
+
INPUT OUTPUT --max-samples 10
|
| 126 |
+
```
|
| 127 |
+
|
| 128 |
+
This is **required** for a few scripts (e.g. `deepseek-ocr2-vllm.py`, `abot-ocr.py`, `nuextract3.py`) and a safe fallback for any vLLM recipe that crashes at startup. (It's also the more robust way to run any vLLM recipe — full CUDA toolkit, ABI-matched build. It isn't a speed-up: uv still reinstalls the script's deps either way.)
|
| 129 |
+
|
| 130 |
## Common Options
|
| 131 |
|
| 132 |
The scripts aim to expose a **consistent interface**: every OCR model script takes `input-dataset output-dataset` as positional arguments, accepts the shared core flags below, and writes a `markdown` column — so switching models is usually just swapping the script URL. Models differ where they need to, though: some add their own flags (task modes, resolution presets, `--think`, vocab sizes), a few need a specific Docker image, and per-model defaults (batch size, context length, temperature) are tuned to each model card. Always check a script's `--help` for its specifics.
|
abot-ocr.py
CHANGED
|
@@ -49,6 +49,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 49 |
from PIL import Image
|
| 50 |
from toolz import partition_all
|
| 51 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
from vllm import LLM, SamplingParams
|
| 53 |
|
| 54 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 49 |
from PIL import Image
|
| 50 |
from toolz import partition_all
|
| 51 |
from tqdm.auto import tqdm
|
| 52 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 53 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 54 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 55 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 56 |
from vllm import LLM, SamplingParams
|
| 57 |
|
| 58 |
logging.basicConfig(level=logging.INFO)
|
deepseek-ocr-vllm.py
CHANGED
|
@@ -48,6 +48,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 48 |
from PIL import Image
|
| 49 |
from toolz import partition_all
|
| 50 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
from vllm import LLM, SamplingParams
|
| 52 |
from vllm.model_executor.models.deepseek_ocr import NGramPerReqLogitsProcessor
|
| 53 |
|
|
|
|
| 48 |
from PIL import Image
|
| 49 |
from toolz import partition_all
|
| 50 |
from tqdm.auto import tqdm
|
| 51 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 52 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 53 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 54 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 55 |
from vllm import LLM, SamplingParams
|
| 56 |
from vllm.model_executor.models.deepseek_ocr import NGramPerReqLogitsProcessor
|
| 57 |
|
deepseek-ocr2-vllm.py
CHANGED
|
@@ -59,6 +59,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 59 |
from PIL import Image
|
| 60 |
from toolz import partition_all
|
| 61 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 62 |
from vllm import LLM, SamplingParams
|
| 63 |
from vllm.model_executor.models.deepseek_ocr import NGramPerReqLogitsProcessor
|
| 64 |
|
|
|
|
| 59 |
from PIL import Image
|
| 60 |
from toolz import partition_all
|
| 61 |
from tqdm.auto import tqdm
|
| 62 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 63 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 64 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 65 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 66 |
from vllm import LLM, SamplingParams
|
| 67 |
from vllm.model_executor.models.deepseek_ocr import NGramPerReqLogitsProcessor
|
| 68 |
|
dots-mocr.py
CHANGED
|
@@ -53,6 +53,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 53 |
from PIL import Image, UnidentifiedImageError
|
| 54 |
from toolz import partition_all
|
| 55 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
from vllm import LLM, SamplingParams
|
| 57 |
|
| 58 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 53 |
from PIL import Image, UnidentifiedImageError
|
| 54 |
from toolz import partition_all
|
| 55 |
from tqdm.auto import tqdm
|
| 56 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 57 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 58 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 59 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 60 |
from vllm import LLM, SamplingParams
|
| 61 |
|
| 62 |
logging.basicConfig(level=logging.INFO)
|
dots-ocr.py
CHANGED
|
@@ -45,6 +45,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 45 |
from PIL import Image
|
| 46 |
from toolz import partition_all
|
| 47 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
from vllm import LLM, SamplingParams
|
| 49 |
|
| 50 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 45 |
from PIL import Image
|
| 46 |
from toolz import partition_all
|
| 47 |
from tqdm.auto import tqdm
|
| 48 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 49 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 50 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 51 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 52 |
from vllm import LLM, SamplingParams
|
| 53 |
|
| 54 |
logging.basicConfig(level=logging.INFO)
|
firered-ocr.py
CHANGED
|
@@ -39,6 +39,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 39 |
from PIL import Image
|
| 40 |
from toolz import partition_all
|
| 41 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
from vllm import LLM, SamplingParams
|
| 43 |
|
| 44 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 39 |
from PIL import Image
|
| 40 |
from toolz import partition_all
|
| 41 |
from tqdm.auto import tqdm
|
| 42 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 43 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 44 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 45 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 46 |
from vllm import LLM, SamplingParams
|
| 47 |
|
| 48 |
logging.basicConfig(level=logging.INFO)
|
glm-ocr-bucket.py
CHANGED
|
@@ -56,6 +56,11 @@ from pathlib import Path
|
|
| 56 |
|
| 57 |
import torch
|
| 58 |
from PIL import Image
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
from vllm import LLM, SamplingParams
|
| 60 |
|
| 61 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
|
|
|
|
| 56 |
|
| 57 |
import torch
|
| 58 |
from PIL import Image
|
| 59 |
+
import os
|
| 60 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 61 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 62 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 63 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 64 |
from vllm import LLM, SamplingParams
|
| 65 |
|
| 66 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(message)s")
|
glm-ocr-v2.py
CHANGED
|
@@ -69,6 +69,10 @@ from datasets import load_dataset
|
|
| 69 |
from huggingface_hub import CommitScheduler, DatasetCard, HfApi, login
|
| 70 |
from PIL import Image
|
| 71 |
from toolz import partition_all
|
|
|
|
|
|
|
|
|
|
|
|
|
| 72 |
from vllm import LLM, SamplingParams
|
| 73 |
|
| 74 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 69 |
from huggingface_hub import CommitScheduler, DatasetCard, HfApi, login
|
| 70 |
from PIL import Image
|
| 71 |
from toolz import partition_all
|
| 72 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 73 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 74 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 75 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 76 |
from vllm import LLM, SamplingParams
|
| 77 |
|
| 78 |
logging.basicConfig(level=logging.INFO)
|
glm-ocr.py
CHANGED
|
@@ -60,6 +60,10 @@ from datasets import load_dataset
|
|
| 60 |
from huggingface_hub import DatasetCard, login
|
| 61 |
from PIL import Image
|
| 62 |
from toolz import partition_all
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
from vllm import LLM, SamplingParams
|
| 64 |
|
| 65 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 60 |
from huggingface_hub import DatasetCard, login
|
| 61 |
from PIL import Image
|
| 62 |
from toolz import partition_all
|
| 63 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 64 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 65 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 66 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 67 |
from vllm import LLM, SamplingParams
|
| 68 |
|
| 69 |
logging.basicConfig(level=logging.INFO)
|
hunyuan-ocr.py
CHANGED
|
@@ -49,6 +49,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 49 |
from PIL import Image
|
| 50 |
from toolz import partition_all
|
| 51 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 52 |
from vllm import LLM, SamplingParams
|
| 53 |
|
| 54 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 49 |
from PIL import Image
|
| 50 |
from toolz import partition_all
|
| 51 |
from tqdm.auto import tqdm
|
| 52 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 53 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 54 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 55 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 56 |
from vllm import LLM, SamplingParams
|
| 57 |
|
| 58 |
logging.basicConfig(level=logging.INFO)
|
lighton-ocr.py
CHANGED
|
@@ -57,6 +57,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 57 |
from PIL import Image
|
| 58 |
from toolz import partition_all
|
| 59 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
from vllm import LLM, SamplingParams
|
| 61 |
|
| 62 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 57 |
from PIL import Image
|
| 58 |
from toolz import partition_all
|
| 59 |
from tqdm.auto import tqdm
|
| 60 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 61 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 62 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 63 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 64 |
from vllm import LLM, SamplingParams
|
| 65 |
|
| 66 |
logging.basicConfig(level=logging.INFO)
|
lighton-ocr2.py
CHANGED
|
@@ -53,6 +53,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 53 |
from PIL import Image
|
| 54 |
from toolz import partition_all
|
| 55 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
from vllm import LLM, SamplingParams
|
| 57 |
|
| 58 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 53 |
from PIL import Image
|
| 54 |
from toolz import partition_all
|
| 55 |
from tqdm.auto import tqdm
|
| 56 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 57 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 58 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 59 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 60 |
from vllm import LLM, SamplingParams
|
| 61 |
|
| 62 |
logging.basicConfig(level=logging.INFO)
|
nanonets-ocr.py
CHANGED
|
@@ -40,6 +40,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 40 |
from PIL import Image
|
| 41 |
from toolz import partition_all
|
| 42 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
from vllm import LLM, SamplingParams
|
| 44 |
from datetime import datetime
|
| 45 |
|
|
|
|
| 40 |
from PIL import Image
|
| 41 |
from toolz import partition_all
|
| 42 |
from tqdm.auto import tqdm
|
| 43 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 44 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 45 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 46 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 47 |
from vllm import LLM, SamplingParams
|
| 48 |
from datetime import datetime
|
| 49 |
|
nanonets-ocr2.py
CHANGED
|
@@ -44,6 +44,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 44 |
from PIL import Image
|
| 45 |
from toolz import partition_all
|
| 46 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 47 |
from vllm import LLM, SamplingParams
|
| 48 |
|
| 49 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 44 |
from PIL import Image
|
| 45 |
from toolz import partition_all
|
| 46 |
from tqdm.auto import tqdm
|
| 47 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 48 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 49 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 50 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 51 |
from vllm import LLM, SamplingParams
|
| 52 |
|
| 53 |
logging.basicConfig(level=logging.INFO)
|
nuextract3.py
CHANGED
|
@@ -70,6 +70,10 @@ from datasets import load_dataset
|
|
| 70 |
from huggingface_hub import DatasetCard, login
|
| 71 |
from PIL import Image
|
| 72 |
from toolz import partition_all
|
|
|
|
|
|
|
|
|
|
|
|
|
| 73 |
from vllm import LLM, SamplingParams
|
| 74 |
|
| 75 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 70 |
from huggingface_hub import DatasetCard, login
|
| 71 |
from PIL import Image
|
| 72 |
from toolz import partition_all
|
| 73 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 74 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 75 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 76 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 77 |
from vllm import LLM, SamplingParams
|
| 78 |
|
| 79 |
logging.basicConfig(level=logging.INFO)
|
numarkdown-ocr.py
CHANGED
|
@@ -47,6 +47,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 47 |
from PIL import Image
|
| 48 |
from toolz import partition_all
|
| 49 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
from vllm import LLM, SamplingParams
|
| 51 |
|
| 52 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 47 |
from PIL import Image
|
| 48 |
from toolz import partition_all
|
| 49 |
from tqdm.auto import tqdm
|
| 50 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 51 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 52 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 53 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 54 |
from vllm import LLM, SamplingParams
|
| 55 |
|
| 56 |
logging.basicConfig(level=logging.INFO)
|
olmocr2-vllm.py
CHANGED
|
@@ -50,6 +50,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 50 |
from PIL import Image
|
| 51 |
from toolz import partition_all
|
| 52 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
from vllm import LLM, SamplingParams
|
| 54 |
from vllm.sampling_params import GuidedDecodingParams
|
| 55 |
|
|
|
|
| 50 |
from PIL import Image
|
| 51 |
from toolz import partition_all
|
| 52 |
from tqdm.auto import tqdm
|
| 53 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 54 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 55 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 56 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 57 |
from vllm import LLM, SamplingParams
|
| 58 |
from vllm.sampling_params import GuidedDecodingParams
|
| 59 |
|
paddleocr-vl-1.6.py
CHANGED
|
@@ -62,6 +62,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 62 |
from PIL import Image
|
| 63 |
from toolz import partition_all
|
| 64 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
from vllm import LLM, SamplingParams
|
| 66 |
|
| 67 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 62 |
from PIL import Image
|
| 63 |
from toolz import partition_all
|
| 64 |
from tqdm.auto import tqdm
|
| 65 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 66 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 67 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 68 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 69 |
from vllm import LLM, SamplingParams
|
| 70 |
|
| 71 |
logging.basicConfig(level=logging.INFO)
|
paddleocr-vl.py
CHANGED
|
@@ -56,6 +56,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 56 |
from PIL import Image
|
| 57 |
from toolz import partition_all
|
| 58 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
from vllm import LLM, SamplingParams
|
| 60 |
|
| 61 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 56 |
from PIL import Image
|
| 57 |
from toolz import partition_all
|
| 58 |
from tqdm.auto import tqdm
|
| 59 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 60 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 61 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 62 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 63 |
from vllm import LLM, SamplingParams
|
| 64 |
|
| 65 |
logging.basicConfig(level=logging.INFO)
|
qianfan-ocr.py
CHANGED
|
@@ -47,6 +47,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 47 |
from PIL import Image
|
| 48 |
from toolz import partition_all
|
| 49 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
from vllm import LLM, SamplingParams
|
| 51 |
|
| 52 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 47 |
from PIL import Image
|
| 48 |
from toolz import partition_all
|
| 49 |
from tqdm.auto import tqdm
|
| 50 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 51 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 52 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 53 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 54 |
from vllm import LLM, SamplingParams
|
| 55 |
|
| 56 |
logging.basicConfig(level=logging.INFO)
|
rolm-ocr.py
CHANGED
|
@@ -40,6 +40,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 40 |
from PIL import Image
|
| 41 |
from toolz import partition_all
|
| 42 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
from vllm import LLM, SamplingParams
|
| 44 |
from datetime import datetime
|
| 45 |
|
|
|
|
| 40 |
from PIL import Image
|
| 41 |
from toolz import partition_all
|
| 42 |
from tqdm.auto import tqdm
|
| 43 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 44 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 45 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 46 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 47 |
from vllm import LLM, SamplingParams
|
| 48 |
from datetime import datetime
|
| 49 |
|
smoldocling-ocr.py
CHANGED
|
@@ -45,6 +45,10 @@ from huggingface_hub import DatasetCard, login
|
|
| 45 |
from PIL import Image, UnidentifiedImageError
|
| 46 |
from toolz import partition_all
|
| 47 |
from tqdm.auto import tqdm
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
from vllm import LLM, SamplingParams
|
| 49 |
|
| 50 |
logging.basicConfig(level=logging.INFO)
|
|
|
|
| 45 |
from PIL import Image, UnidentifiedImageError
|
| 46 |
from toolz import partition_all
|
| 47 |
from tqdm.auto import tqdm
|
| 48 |
+
# Disable vLLM's FlashInfer sampler: it JIT-compiles a CUDA kernel needing nvcc, which the
|
| 49 |
+
# default uv-script image lacks (engine init then crashes). Greedy OCR doesn't use it; this
|
| 50 |
+
# lets the plain default-image command work. On the vllm/vllm-openai image it's a harmless no-op.
|
| 51 |
+
os.environ.setdefault("VLLM_USE_FLASHINFER_SAMPLER", "0")
|
| 52 |
from vllm import LLM, SamplingParams
|
| 53 |
|
| 54 |
logging.basicConfig(level=logging.INFO)
|