Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +4 -1
Dockerfile
CHANGED
|
@@ -1,5 +1,7 @@
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
|
|
|
|
|
|
| 3 |
# Install build dependencies for packages such as uvicorn[standard]
|
| 4 |
RUN apt-get update && \
|
| 5 |
apt-get install -y --no-install-recommends build-essential git && \
|
|
@@ -24,7 +26,8 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 24 |
pip install --no-cache-dir -r requirements.txt
|
| 25 |
|
| 26 |
# Pre-download the SentenceTransformer embedding model to avoid runtime cold-starts
|
| 27 |
-
RUN
|
|
|
|
| 28 |
from sentence_transformers import SentenceTransformer
|
| 29 |
|
| 30 |
SentenceTransformer("google/embeddinggemma-300m")
|
|
|
|
| 1 |
FROM python:3.11-slim
|
| 2 |
|
| 3 |
+
ARG HF_TOKEN
|
| 4 |
+
|
| 5 |
# Install build dependencies for packages such as uvicorn[standard]
|
| 6 |
RUN apt-get update && \
|
| 7 |
apt-get install -y --no-install-recommends build-essential git && \
|
|
|
|
| 26 |
pip install --no-cache-dir -r requirements.txt
|
| 27 |
|
| 28 |
# Pre-download the SentenceTransformer embedding model to avoid runtime cold-starts
|
| 29 |
+
RUN HF_TOKEN=$HF_TOKEN HUGGINGFACEHUB_API_TOKEN=$HF_TOKEN HUGGINGFACE_HUB_TOKEN=$HF_TOKEN \
|
| 30 |
+
python - <<'PY'
|
| 31 |
from sentence_transformers import SentenceTransformer
|
| 32 |
|
| 33 |
SentenceTransformer("google/embeddinggemma-300m")
|