Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +5 -6
Dockerfile
CHANGED
@@ -6,13 +6,14 @@ RUN apt-get update \
|
|
6 |
&& rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
# 2) Set HF & numba cache + runtime ENVs
|
|
|
9 |
ENV HF_HOME=/tmp/hfcache \
|
10 |
TRANSFORMERS_CACHE=/tmp/hfcache \
|
11 |
SENTENCE_TRANSFORMERS_HOME=/tmp/hfcache \
|
12 |
NUMBA_CACHE_DIR=/tmp/numba_cache \
|
13 |
PIP_NO_CACHE_DIR=1 \
|
14 |
PYTHONUNBUFFERED=1 \
|
15 |
-
EMBED_MODEL=
|
16 |
MIN_TOPIC_SIZE=10 \
|
17 |
MAX_DOCS=5000
|
18 |
|
@@ -23,16 +24,14 @@ RUN mkdir -p /tmp/hfcache /tmp/numba_cache \
|
|
23 |
# 4) Copy & install Python deps
|
24 |
WORKDIR /code
|
25 |
COPY requirements.txt .
|
26 |
-
|
27 |
-
# Install dependencies
|
28 |
RUN pip install --upgrade pip \
|
29 |
&& pip install --no-cache-dir -r requirements.txt
|
30 |
|
31 |
-
# 5) Pre-download your Czech SBERT into that cache
|
32 |
RUN python - <<'PY'
|
33 |
from sentence_transformers import SentenceTransformer
|
34 |
SentenceTransformer(
|
35 |
-
'
|
36 |
cache_folder='/tmp/hfcache'
|
37 |
)
|
38 |
PY
|
@@ -40,4 +39,4 @@ PY
|
|
40 |
# 6) Copy in your app & run
|
41 |
COPY app.py .
|
42 |
EXPOSE 7860
|
43 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
6 |
&& rm -rf /var/lib/apt/lists/*
|
7 |
|
8 |
# 2) Set HF & numba cache + runtime ENVs
|
9 |
+
# Use lowercase model ID to match HF repo
|
10 |
ENV HF_HOME=/tmp/hfcache \
|
11 |
TRANSFORMERS_CACHE=/tmp/hfcache \
|
12 |
SENTENCE_TRANSFORMERS_HOME=/tmp/hfcache \
|
13 |
NUMBA_CACHE_DIR=/tmp/numba_cache \
|
14 |
PIP_NO_CACHE_DIR=1 \
|
15 |
PYTHONUNBUFFERED=1 \
|
16 |
+
EMBED_MODEL=seznam/simcse-small-e-czech \
|
17 |
MIN_TOPIC_SIZE=10 \
|
18 |
MAX_DOCS=5000
|
19 |
|
|
|
24 |
# 4) Copy & install Python deps
|
25 |
WORKDIR /code
|
26 |
COPY requirements.txt .
|
|
|
|
|
27 |
RUN pip install --upgrade pip \
|
28 |
&& pip install --no-cache-dir -r requirements.txt
|
29 |
|
30 |
+
# 5) Pre-download your Czech SBERT into that cache (lowercase ID)
|
31 |
RUN python - <<'PY'
|
32 |
from sentence_transformers import SentenceTransformer
|
33 |
SentenceTransformer(
|
34 |
+
'seznam/simcse-small-e-czech',
|
35 |
cache_folder='/tmp/hfcache'
|
36 |
)
|
37 |
PY
|
|
|
39 |
# 6) Copy in your app & run
|
40 |
COPY app.py .
|
41 |
EXPOSE 7860
|
42 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|