enskaff commited on
Commit
2d5cc5e
·
verified ·
1 Parent(s): ecf0751

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -1
Dockerfile CHANGED
@@ -24,11 +24,12 @@ RUN pip3 install --no-cache-dir --upgrade pip && \
24
 
25
  # Download the model using BuildKit secret mount.
26
  # This command uses the secret HF_TOKEN, which is passed only during this RUN and not stored in the image.
27
- RUN --mount=type=secret,id=HF_TOKEN,env=HF_TOKEN \
28
  python3 -c "import os; \
29
  from huggingface_hub import snapshot_download; \
30
  token = os.getenv('HF_TOKEN'); \
31
  assert token, 'HF_TOKEN is not set!'; \
 
32
  snapshot_download(repo_id='mistralai/Mistral-7B-Instruct-v0.1', local_dir='/app/model', token=token)"
33
 
34
  # Expose port 8000
 
24
 
25
  # Download the model using BuildKit secret mount.
26
  # This command uses the secret HF_TOKEN, which is passed only during this RUN and not stored in the image.
27
+ RUN --mount=type=secret,id=HF_TOKEN,env=HF_TOKEN,mode=0444,required=true \
28
  python3 -c "import os; \
29
  from huggingface_hub import snapshot_download; \
30
  token = os.getenv('HF_TOKEN'); \
31
  assert token, 'HF_TOKEN is not set!'; \
32
+ print('Token is set. Downloading model...'); \
33
  snapshot_download(repo_id='mistralai/Mistral-7B-Instruct-v0.1', local_dir='/app/model', token=token)"
34
 
35
  # Expose port 8000