File size: 990 Bytes
3cf5419
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Use a high-performance CUDA base image
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04

# Set environment variables for non-interactive installs
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHONUNBUFFERED=1

# Install Python and essential build tools
RUN apt-get update && apt-get install -y \
    python3-pip \
    python3-dev \
    git \
    && rm -rf /var/lib/apt/lists/*

# Upgrade pip and install wheel
RUN pip3 install --no-cache-dir --upgrade pip wheel

# Install Unsloth and its core dependencies
# We use the specific install command recommended for CUDA 12.1
RUN pip3 install --no-cache-dir \
    "unsloth[colab-new] @ git+https://github.com" \
    --extra-index-url https://download.pytorch.org

# Install TRL and Transformers for the Trainer subclassing
RUN pip3 install --no-cache-dir trl transformers accelerate datasets

# Set the working directory
WORKDIR /app

# Copy your custom logic into the container
COPY . /app

# The entrypoint to start training
CMD ["python3", "train.py"]