File size: 1,051 Bytes
0daf510
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM nvidia/cuda:12.1.0-devel-ubuntu22.04

RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
    git git-lfs curl rsync jq ca-certificates python3 python3-pip python3-venv \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install

# Python deps for training
RUN pip3 install --no-cache-dir \
    'transformers>=4.43' \
    'accelerate>=0.33' \
    'datasets>=2.20' \
    'peft>=0.11' \
    'bitsandbytes>=0.43' \
    'deepspeed>=0.14' \
    'huggingface_hub[cli]>=0.23' \
    'torch>=2.3' 'torchvision' 'torchaudio' --extra-index-url https://download.pytorch.org/whl/cu121

# Optional: flash-attn (commented to avoid long builds)
# RUN pip3 install --no-cache-dir flash-attn --no-build-isolation

ENV HF_HOME=/var/cache/hf \
    TRANSFORMERS_CACHE=/var/cache/hf \
    HF_MODULES_CACHE=/var/cache/hf/modules
RUN mkdir -p /var/cache/hf && chmod -R 777 /var/cache/hf

WORKDIR /opt/elizabeth/train

# Minimal bootstrap scripts
COPY docker/train/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

CMD ["/entrypoint.sh"]