Image: OCR models from Hugging Face, pinned to a commit

e03a73e · Gabe Morell · 2026-10-27 20:04

1 files +9 -2
Message
{commit_body(@commit)}

Files changed

modified Dockerfile
+9 −2
@@ -70,10 +70,17 @@ RUN cargo build --release \
70 70 # create its output file ("Permission denied", even in a freshly mkdir'd
71 71 # directory), while the builder fetching the URL itself needs no RUN step
72 72 # at all — and so no base image, apt or curl either.
73 +#
74 +# From the ocrs models' Hugging Face repo, pinned to a commit: a
75 +# resolve/<commit>/ URL can't change under us. The S3 bucket ocrs used to
76 +# point at has moved its files around — the .rten names now 403 (the
77 +# bucket serves .onnx, which rten 0.21 can't load). These are the same
78 +# published checkpoints, in the header-less .rten format (V1) rten reads.
73 79 # ---------------------------------------------------------------------------
74 80 FROM scratch AS ocr-models
75 −ADD --chmod=0644 https://ocrs-models.s3-accelerate.amazonaws.com/text-detection.rten /models/text-detection.rten
76 −ADD --chmod=0644 https://ocrs-models.s3-accelerate.amazonaws.com/text-recognition.rten /models/text-recognition.rten
81 +ARG OCRS_MODELS=https://huggingface.co/robertknight/ocrs/resolve/df0edd170279ab971b53e094c627255a87e1a503
82 +ADD --chmod=0644 ${OCRS_MODELS}/text-detection-ssfbcj81.rten /models/text-detection.rten
83 +ADD --chmod=0644 ${OCRS_MODELS}/text-rec-checkpoint-s52qdbqt.rten /models/text-recognition.rten
77 84
78 85 # ---------------------------------------------------------------------------
79 86 # Stage 4 — runtime: minimal Debian slim with the binaries + assets + templates.

Parents: 6228e32