training_model_v1 / Dockerfile
Emanuele Mercadante
s
fd1547e
raw
history blame
837 Bytes
# Utilizza l'immagine base ufficiale di Hugging Face per PyTorch con supporto GPU
FROM huggingface/transformers-pytorch-gpu:latest
# Installa le dipendenze di sistema
RUN apt-get update && apt-get install -y \
git \
wget \
&& rm -rf /var/lib/apt/lists/*
# Imposta le variabili d'ambiente per il token e l'utente
ENV HUGGINGFACE_TOKEN=hf_1234567890abcdef1234567890abcdef12345678
ENV HUGGINGFACE_USER=Rathalos
ENV HUGGINGFACE_REPO=training_incite
# Clona il repository privato
RUN git clone https://${HUGGINGFACE_TOKEN}@huggingface.co/spaces/${HUGGINGFACE_USER}/${HUGGINGFACE_REPO}.git /app
WORKDIR /app
# Copia il file requirements.txt e installa le dipendenze Python
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Comando per eseguire lo script di training
CMD ["python", "train_model.py"]