dimercia / Dockerfile
dieumercimvemba's picture
Update Dockerfile
130e055 verified
Raw
History Blame Contribute Delete
838 Bytes
FROM python:3.11-slim
WORKDIR /app
# Plus besoin de cmake ou build-essential, juste wget pour le modèle
RUN apt-get update && apt-get install -y \
wget \
&& rm -rf /var/lib/apt/lists/*
# Téléchargement du modèle
RUN mkdir -p /app/models && \
wget -O /app/models/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf \
https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF/resolve/main/qwen2.5-coder-1.5b-instruct-q4_k_m.gguf
# 1. Installer les dépendances classiques
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 2. LE FIX OOM : Installer llama-cpp-python depuis les binaires pré-compilés CPU
RUN pip install --no-cache-dir llama-cpp-python \
--extra-index-url https://abetlen.github.io/llama-cpp-python/whl/cpu
# Copie de l'API
COPY app.py .
EXPOSE 7860
CMD ["python", "app.py"]