File size: 1,073 Bytes
ac63843 d5238a3 bddccbe 86ec003 bddccbe 86ec003 d5238a3 bddccbe 86ec003 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | FROM nvidia/cuda:12.1.0-devel-ubuntu22.04
# Install Python and dependencies
RUN apt-get update && apt-get install -y \
python3.11 python3-pip git wget curl \
&& rm -rf /var/lib/apt/lists/*
# Set Python 3.11 as default
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1
RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1
RUN update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
# Install PyTorch and ML libraries using python3 -m pip to ensure correct Python
RUN python3 -m pip install --no-cache-dir \
torch==2.3.0 \
transformers>=4.45.0 \
datasets>=2.18.0 \
trl>=0.12.0 \
peft>=0.10.0 \
accelerate>=0.30.0 \
bitsandbytes>=0.43.0 \
anthropic>=0.39.0 \
huggingface_hub>=0.24.0 \
pyyaml \
gradio
# Set working directory
WORKDIR /app
# Copy training code
COPY . /app/
# Environment variables
ENV PYTHONUNBUFFERED=1
ENV HF_HUB_ENABLE_HF_TRANSFER=1
# Expose Gradio port
EXPOSE 7860
# Run training app with python3 explicitly
CMD ["python3", "app.py"] |