FROM python:3.10-slim # system deps RUN apt-get update && apt-get install -y git build-essential && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY . /app # pip upgrade RUN pip install --no-cache-dir --upgrade pip # 🔥 FIXED: compatible transformers version RUN pip install --no-cache-dir \ torch==2.1.2+cpu \ torchvision \ torchaudio \ --index-url https://download.pytorch.org/whl/cpu RUN pip install --no-cache-dir \ transformers==4.38.2 \ gradio \ accelerate \ sentencepiece \ huggingface_hub \ flask # optional (HF token support) ENV HF_HOME=/app/cache ENV TRANSFORMERS_CACHE=/app/cache EXPOSE 7860 CMD ["python", "app2.py"]