Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +7 -1
Dockerfile
CHANGED
|
@@ -14,10 +14,16 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|
| 14 |
# Copy application code
|
| 15 |
COPY . .
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# Hugging Face cache directory
|
| 18 |
ENV HF_HOME=/tmp/huggingface
|
| 19 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 20 |
-
|
| 21 |
|
| 22 |
# Expose FastAPI port
|
| 23 |
EXPOSE 7860
|
|
|
|
| 14 |
# Copy application code
|
| 15 |
COPY . .
|
| 16 |
|
| 17 |
+
# Pre-download model into app folder (readable by the app process)
|
| 18 |
+
RUN mkdir -p /tmp/huggingface
|
| 19 |
+
RUN python -c "from transformers import AutoTokenizer, AutoModelForCausalLM; \
|
| 20 |
+
model_id='deepseek-ai/DeepSeek-R1'; \
|
| 21 |
+
AutoTokenizer.from_pretrained(model_id, cache_dir='/tmp/huggingface'); \
|
| 22 |
+
AutoModelForCausalLM.from_pretrained(model_id, cache_dir='/tmp/huggingface')"
|
| 23 |
# Hugging Face cache directory
|
| 24 |
ENV HF_HOME=/tmp/huggingface
|
| 25 |
ENV TRANSFORMERS_CACHE=/tmp/huggingface
|
| 26 |
+
|
| 27 |
|
| 28 |
# Expose FastAPI port
|
| 29 |
EXPOSE 7860
|