LiamKhoaLe commited on
Commit
fcc3df9
·
1 Parent(s): d5e8ec5

Update Dockerfile migration of dir

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -1
Dockerfile CHANGED
@@ -25,7 +25,10 @@ RUN mkdir -p $SENTENCE_TRANSFORMERS_HOME && \
25
  # Download and persist the model properly (USE snapshot_download)
26
  RUN python -c "from huggingface_hub import snapshot_download; \
27
  model_path = snapshot_download(repo_id='sentence-transformers/all-MiniLM-L6-v2', cache_dir='/app/model_cache'); \
28
- print(f'Model downloaded to: {model_path}')"
 
 
 
29
 
30
  # Ensure the model files are available at runtime (list out)
31
  RUN ls -l /app/model_cache && cat /app/model_cache/config.json
 
25
  # Download and persist the model properly (USE snapshot_download)
26
  RUN python -c "from huggingface_hub import snapshot_download; \
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/')"
32
 
33
  # Ensure the model files are available at runtime (list out)
34
  RUN ls -l /app/model_cache && cat /app/model_cache/config.json