Spaces:
Running
Running
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker | |
# you will also find guides on how best to write your Dockerfile | |
FROM python:3.12.3 | |
RUN useradd -m -u 1000 user | |
USER user | |
ENV PATH="/home/user/.local/bin:$PATH" | |
# Add environment variable to force CPU usage | |
ENV LLAMA_CPP_FORCE_CPU=1 | |
# Create a directory for the app | |
WORKDIR /app | |
# Download the model | |
RUN wget -O DeepSeek-R1-Distill-Llama-8B-Q4_K_L.gguf \ | |
"https://huggingface.co/bartowski/DeepSeek-R1-Distill-Llama-8B-GGUF/resolve/main/DeepSeek-R1-Distill-Llama-8B-Q4_K_L.gguf" | |
RUN wget -O DeepSeek-R1-Distill-Qwen-1.5B-Q2_K.gguf \ | |
"https://huggingface.co/bartowski/DeepSeek-R1-Distill-Qwen-1.5B-GGUF/resolve/main/DeepSeek-R1-Distill-Qwen-1.5B-Q2_K.gguf" | |
# Copy the files to the container | |
COPY --chown=user . /app | |
# Install the requirements | |
RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
# Expose the port | |
EXPOSE 8000 | |
# Command to start the server | |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"] | |