Fixes batch 1

This commit is contained in:
Pavel committed 2026-09-02 23:42:35 +04:00
1 parent 96b878217d
commit 47eb92fc42
12 files changed
+515 -46

No files matched your search

+1 -1
View File
@@ -220,7 +220,7 @@ for the engines and flows.
| `OCR_LANGS` | `eng` | Tesseract language packs, `+`-separated (e.g. `eng+chi_sim+deu`). |
| `OCR_DEEPSEEK_URL` | `http://localhost:11434/v1/chat/completions` | OpenAI-compatible endpoint for `OCR_ENGINE=deepseek` (Ollama or vLLM). |
| `OCR_DEEPSEEK_MODEL` | `deepseek-ocr:3b` | Model name at that endpoint. |
| `OCR_DEEPSEEK_TIMEOUT` | `300` | Native backend: seconds allowed per page request to the DeepSeek endpoint (pages are sent one at a time). |
| `OCR_DEEPSEEK_TIMEOUT` | `300` | Seconds allowed per page request to the DeepSeek endpoint, on both backends (the native backend sends pages one at a time). |
| `OCR_RENDER_DPI` | `200` | Native backend: resolution at which pages without a text layer are rendered before OCR (clamped to 72-600). |
| `OCR_MIN_CHARS_PER_PAGE` | `20` | Chars-per-page floor below which an OCR'd parse is treated as an OCR dropout and fails loudly instead of indexing an empty document; `0` disables. Alias: `DOCLING_OCR_MIN_CHARS_PER_PAGE`. |
+4 -3
View File
@@ -142,14 +142,15 @@ For `deepseek`, point the worker at an OpenAI-compatible endpoint:
OCR_ENGINE=deepseek
OCR_DEEPSEEK_URL=http://localhost:11434/v1/chat/completions # Ollama default
OCR_DEEPSEEK_MODEL=deepseek-ocr:3b
OCR_DEEPSEEK_TIMEOUT=300 # native backend: seconds per page
OCR_DEEPSEEK_TIMEOUT=300 # seconds per page request, both backends
```
Ollama works out of the box (`ollama pull deepseek-ocr:3b`); for real
throughput serve `deepseek-ai/DeepSeek-OCR` with vLLM on a GPU and set the
URL accordingly. The native backend sends pages one at a time, so a slow
laptop-hosted model only needs a generous `OCR_DEEPSEEK_TIMEOUT`; docling's
VLM pipeline uses its own 90 s timeout and four concurrent requests.
VLM pipeline honours the same timeout per request but keeps its own four
concurrent requests.
A selected engine that is not available degrades rather than failing parses:
under docling, a missing tesseract binary or non-macOS `ocrmac` falls back to
@@ -177,7 +178,7 @@ difference matters more than for tesseract:
- **docling** uses its VLM pipeline, which *replaces* the whole converter:
every page of every PDF that reaches docling goes to the model, text layer
or not (a 39-page text PDF measured 721 s against 20 s on the other paths),
with four concurrent requests and a fixed 90 s timeout. In testing it also
with four concurrent requests and `OCR_DEEPSEEK_TIMEOUT` per request. In testing it also
dropped page-level elements — a title, an intro paragraph — that the same
model kept through the native path, and it logs a burst of pydantic
serialization warnings per conversion. Its one advantage was table