File size: 1,291 Bytes
a6fbb35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
42
43
FROM huggingface/transformers-pytorch-gpu:latest

WORKDIR /app

# Instalar dependências do sistema
# python-is-python3 cria automaticamente o symlink python -> python3
RUN apt-get update && apt-get install -y --no-install-recommends \
    git \
    python3 \
    python3-pip \
    python-is-python3 \
    && rm -rf /var/lib/apt/lists/*

# Verificar que python está disponível (entrypoint do NVIDIA precisa)
RUN python --version && \
    python3 --version && \
    echo "✅ Python disponível: $(which python)"

# Instalar dependências Python
COPY requirements.txt .
RUN python3 -m pip install --no-cache-dir --upgrade pip && \
    python3 -m pip install --no-cache-dir -r requirements.txt

# Copiar scripts de treinamento
COPY train.py /app/train.py
COPY app.py /app/app.py

# Criar diretório de logs
RUN mkdir -p /app/logs

# Configurar variáveis de ambiente padrão (podem ser sobrescritas)
ENV MODEL_NAME=microsoft/Phi-3-mini-4k-instruct
ENV DATASET_REPO=beAnalytic/eda-training-dataset
ENV OUTPUT_REPO=beAnalytic/eda-llm-model
ENV OMP_NUM_THREADS=1
ENV PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True

# Executar treinamento
# Usar 'python' (que será o symlink para python3 criado acima)
# O entrypoint do NVIDIA espera 'python' estar disponível
CMD ["python", "/app/app.py"]