LiamKhoaLe commited on
Commit
efd3ed6
·
1 Parent(s): f9eef45

Update Dockerfile migration of dir

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -5
Dockerfile CHANGED
@@ -25,15 +25,13 @@ 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
- import shutil, os; \
29
- latest_model_dir = os.path.join(model_path, 'snapshots', os.listdir(os.path.join(model_path, 'snapshots'))[0]); \
30
- shutil.move(latest_model_dir, '/app/model_cache/model')"
31
-
32
  # Ensure the model files are available at runtime (list out)
33
  RUN ls -l /app/model_cache && cat /app/model_cache/config.json
34
 
35
  # Ensure ownership and permissions remain intact
36
- RUN chown -R user:user /app/model_cache
37
 
38
  # Expose application port
39
  EXPOSE 7860
 
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
32
 
33
  # Ensure ownership and permissions remain intact
34
+ RUN ls -l /app/model_cache
35
 
36
  # Expose application port
37
  EXPOSE 7860