Nomio4640 Claude Sonnet 4.6 commited on
Commit
bb7b11b
·
1 Parent(s): 233bc02

Pre-download NER model at Docker build time for HF Space

Browse files

Avoids 677MB model download on first user request.
Model cached in image from Nomio4640/ner-mongolian during build.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. Dockerfile +4 -0
Dockerfile CHANGED
@@ -25,6 +25,10 @@ RUN pip install --no-cache-dir -r requirements.txt
25
  COPY nlp_core/ ./nlp_core/
26
  COPY adapters/ ./adapters/
27
 
 
 
 
 
28
  COPY --from=frontend-builder /app/frontend/.next ./frontend/.next
29
  COPY --from=frontend-builder /app/frontend/public ./frontend/public
30
  COPY --from=frontend-builder /app/frontend/package*.json ./frontend/
 
25
  COPY nlp_core/ ./nlp_core/
26
  COPY adapters/ ./adapters/
27
 
28
+ # Pre-download NER model weights from HuggingFace Hub at build time
29
+ # so the first request is fast (no 677MB download on startup)
30
+ RUN python -c "from huggingface_hub import snapshot_download; snapshot_download('Nomio4640/ner-mongolian')"
31
+
32
  COPY --from=frontend-builder /app/frontend/.next ./frontend/.next
33
  COPY --from=frontend-builder /app/frontend/public ./frontend/public
34
  COPY --from=frontend-builder /app/frontend/package*.json ./frontend/