Spaces:
Paused
Paused
Commit
·
70865a3
1
Parent(s):
ea61392
Fixing model download issue v11
Browse files- Dockerfile +8 -24
Dockerfile
CHANGED
@@ -28,30 +28,14 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
28 |
RUN mkdir -p /app/main/checkpoints && \
|
29 |
chmod 777 /app/main/checkpoints
|
30 |
|
31 |
-
#
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
echo "Checkpoints directory:" && \
|
40 |
-
ls -la /app/main/checkpoints && \
|
41 |
-
echo "Testing huggingface-cli" && \
|
42 |
-
huggingface-cli whoami
|
43 |
-
|
44 |
-
# Download model using litgpt command line with verbose output
|
45 |
-
RUN if [ -n "$HF_TOKEN" ]; then \
|
46 |
-
echo "Starting model download..." && \
|
47 |
-
litgpt download mistralai/Mistral-7B-Instruct-v0.3 \
|
48 |
-
--access_token ${HF_TOKEN} \
|
49 |
-
--checkpoint_dir /app/main/checkpoints \
|
50 |
-
--verbose || { echo "Download failed with status $?"; exit 1; }; \
|
51 |
-
else \
|
52 |
-
echo "No Hugging Face token provided. Models will need to be downloaded separately."; \
|
53 |
-
exit 1; \
|
54 |
-
fi
|
55 |
|
56 |
# Copy the rest of the application
|
57 |
COPY . .
|
|
|
28 |
RUN mkdir -p /app/main/checkpoints && \
|
29 |
chmod 777 /app/main/checkpoints
|
30 |
|
31 |
+
# Download model using litgpt command line with proper secret mounting
|
32 |
+
RUN --mount=type=secret,id=HF_TOKEN,mode=0444,required=true \
|
33 |
+
export HF_TOKEN=$(cat /run/secrets/HF_TOKEN) && \
|
34 |
+
echo "Starting model download..." && \
|
35 |
+
litgpt download mistralai/Mistral-7B-Instruct-v0.3 \
|
36 |
+
--access_token ${HF_TOKEN} \
|
37 |
+
--checkpoint_dir /app/main/checkpoints \
|
38 |
+
--verbose || { echo "Download failed with status $?"; exit 1; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
# Copy the rest of the application
|
41 |
COPY . .
|