One entryMerged PR· crunch.stumason.dev· PHP
PR #26 merged: Fix empty PaddleOCR on prod: pin sidecar to py3.13 + build self-test (#13)
additions
+49
deletions
-5
files changed
2
Follow-up to #25.
Symptom
Live, engine=paddle returned {"text":""} (200, ~0.17s, no error) while engine=tesseract read the same image fine through the same sidecar — so paddle's predict() produced zero detections.
Root cause
The sidecar shipped on python:3.11-slim (cp311 paddlepaddle wheel), but PaddleOCR was only validated on python 3.13 (cp313 wheel) in the sandbox. The cp311 ABI on this box runs without error yet yields no output — a silent wheel/ABI mismatch.
Fix
- Pin the sidecar to
python:3.13-slim— the exact wheel/ABI I validated (cp313 aarch64 wheel confirmed on PyPI). - Add
selftest.py, run at build: render a text image → run paddle → assert non-empty. Doubles as the model pre-bake. Since the build runs on the same box as runtime, a silently-empty paddle now fails the build loudly instead of shipping a dead engine. Verified locally: reads "Upgrade Plan".
Tesseract (the default, 95% path) was unaffected and already live. I'll confirm engine=paddle returns real text once this deploys.
🤖 Generated with Claude Code