Download KenLM at server startup, not Docker build

#2
by chirag18 - opened

PR #1 left the Space in BUILD_ERROR โ€” the curl-in-Dockerfile step
for the 240 MB LM failed (most likely a build-time network or
timeout limit). Moving the download into server.py via
urllib.request makes it more robust:

  • No apt/curl install needed (Python stdlib only)
  • Build is fast and reliable
  • /health surfaces a clean 'not yet downloaded' status
  • LM file is hot-swappable without rebuilds

If the download fails, server still starts โ€” falls back to non-LM
beam search (the existing graceful path).

deepakkaura changed pull request status to merged

Sign up or log in to comment