Spaces:
Running
Running
Commit
·
5813c39
1
Parent(s):
fcc3df9
Update Dockerfile py3.11 syntax
Browse files- Dockerfile +2 -2
Dockerfile
CHANGED
@@ -23,9 +23,9 @@ RUN mkdir -p $SENTENCE_TRANSFORMERS_HOME && \
|
|
23 |
chown -R user:user /home/user/.cache/huggingface
|
24 |
|
25 |
# Download and persist the model properly (USE snapshot_download)
|
26 |
-
RUN python -c "
|
|
|
27 |
model_path = snapshot_download(repo_id='sentence-transformers/all-MiniLM-L6-v2', cache_dir='/app/model_cache'); \
|
28 |
-
import shutil, os; \
|
29 |
snapshot_dir = os.path.join(model_path, 'snapshots', os.listdir(os.path.join(model_path, 'snapshots'))[0]); \
|
30 |
for filename in os.listdir(snapshot_dir): \
|
31 |
shutil.move(os.path.join(snapshot_dir, filename), '/app/model_cache/')"
|
|
|
23 |
chown -R user:user /home/user/.cache/huggingface
|
24 |
|
25 |
# Download and persist the model properly (USE snapshot_download)
|
26 |
+
RUN python -c "import os, shutil; \
|
27 |
+
from huggingface_hub import snapshot_download; \
|
28 |
model_path = snapshot_download(repo_id='sentence-transformers/all-MiniLM-L6-v2', cache_dir='/app/model_cache'); \
|
|
|
29 |
snapshot_dir = os.path.join(model_path, 'snapshots', os.listdir(os.path.join(model_path, 'snapshots'))[0]); \
|
30 |
for filename in os.listdir(snapshot_dir): \
|
31 |
shutil.move(os.path.join(snapshot_dir, filename), '/app/model_cache/')"
|