Update Dockerfile
Browse files- Dockerfile +3 -9
Dockerfile
CHANGED
|
@@ -16,17 +16,11 @@ COPY main.py .
|
|
| 16 |
RUN useradd -m -u 1000 user
|
| 17 |
|
| 18 |
# Pre-download model into the image cache so cold starts are fast.
|
| 19 |
-
# The || true ensures a network failure during build doesn't break the image
|
| 20 |
-
# the model will simply be downloaded on first startup instead.
|
| 21 |
RUN python -c "\
|
| 22 |
-
import builtins; builtins.input = lambda p='': 'y'; \
|
| 23 |
import os; os.environ['HF_HUB_VERBOSITY'] = 'error'; \
|
| 24 |
-
from
|
| 25 |
-
|
| 26 |
-
'jinaai/jina-embeddings-v2-base-code', \
|
| 27 |
-
trust_remote_code=True, \
|
| 28 |
-
low_cpu_mem_usage=True, \
|
| 29 |
-
); \
|
| 30 |
print('Model cached.')" || echo "Model pre-cache skipped — will download at runtime."
|
| 31 |
|
| 32 |
USER user
|
|
|
|
| 16 |
RUN useradd -m -u 1000 user
|
| 17 |
|
| 18 |
# Pre-download model into the image cache so cold starts are fast.
|
| 19 |
+
# The || true ensures a network failure during build doesn't break the image.
|
|
|
|
| 20 |
RUN python -c "\
|
|
|
|
| 21 |
import os; os.environ['HF_HUB_VERBOSITY'] = 'error'; \
|
| 22 |
+
from sentence_transformers import SentenceTransformer; \
|
| 23 |
+
SentenceTransformer('jinaai/jina-embeddings-v2-base-code', trust_remote_code=True); \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
print('Model cached.')" || echo "Model pre-cache skipped — will download at runtime."
|
| 25 |
|
| 26 |
USER user
|