Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +3 -5
Dockerfile
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
| 3 |
ARG HF_TOKEN
|
| 4 |
|
| 5 |
# Install build dependencies for packages such as uvicorn[standard]
|
|
@@ -26,11 +27,8 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 26 |
pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
# Pre-download the SentenceTransformer embedding model to avoid runtime cold-starts
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
exit 1; \
|
| 32 |
-
fi && \
|
| 33 |
-
HF_TOKEN=$HF_TOKEN python - <<'PY'
|
| 34 |
import os
|
| 35 |
from sentence_transformers import SentenceTransformer
|
| 36 |
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
# Declare your environment variables with the ARG directive
|
| 4 |
ARG HF_TOKEN
|
| 5 |
|
| 6 |
# Install build dependencies for packages such as uvicorn[standard]
|
|
|
|
| 27 |
pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
| 29 |
# Pre-download the SentenceTransformer embedding model to avoid runtime cold-starts
|
| 30 |
+
# You can use them like environment variables
|
| 31 |
+
RUN python - <<'PY'
|
|
|
|
|
|
|
|
|
|
| 32 |
import os
|
| 33 |
from sentence_transformers import SentenceTransformer
|
| 34 |
|