fix: remove warmup OCR call — causes OOM on 6G container
All checks were successful
CI / go-lint (push) Has been skipped
CI / python-lint (push) Has been skipped
CI / nodejs-lint (push) Has been skipped
CI / test-go-consent (push) Successful in 38s
CI / test-python-voice (push) Successful in 38s
CI / test-bqas (push) Successful in 50s
CI / Deploy (push) Successful in 2s

The warmup OCR call during startup pushes memory over 6G and causes
OOM kills + restart loops. First real OCR request will be slow
(JIT compilation) but container stays stable.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Admin
2026-03-13 18:24:55 +01:00
parent 23694b6555
commit ffd3fd1d7c

View File

@@ -48,13 +48,6 @@ def _load_model():
logger.info(f"PaddleOCR init strategy {i} failed: {e}")
else:
raise RuntimeError("All PaddleOCR init strategies failed")
# Warmup: run a dummy OCR to trigger JIT compilation
# Without this, the first real request takes minutes on CPU
logger.info("Running warmup OCR (JIT compilation)...")
dummy = np.ones((50, 200, 3), dtype=np.uint8) * 255
_engine.ocr(dummy)
logger.info("Warmup complete")
_ready = True
logger.info("PaddleOCR model loaded successfully — ready to serve")
except Exception as e: