Stu Mason · Folkestone, Kent
One entryMerged PR· crunch.stumason.dev· PHP

PR #27 merged: Fix empty PaddleOCR at runtime: pin HOME + self-verify on load (#13)

additions
+42
deletions
-2
files changed
2

Follow-up to #25/#26.

The py3.13 build self-test passes (paddle reads text at build) yet runtime returns empty in ~0.2s with no error — the signature of a model-cache path divergence: the build RUN bakes PP-OCRv6 models to /root/.paddlex (HOME=/root), but the runtime container's HOME isn't guaranteed to be /root, so PaddleOCR resolves an empty cache and silently no-ops.

  • ENV HOME=/root so the build bake and the runtime process share the same ~/.paddlex.
  • get_paddle() self-verifies on first load (reads a synthetic word) and raises if it can't — engine=paddle now returns a loud 5xx instead of a silently-empty 200. Validated locally on 3.13.

Tesseract (default) is unaffected and live. I'll force a clean rebuild and confirm engine=paddle returns real text.