Spaces:
Sleeping
Sleeping
| # CERNenv trainer Space (Docker, A100) | |
| FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| HF_HOME=/home/user/.cache/huggingface \ | |
| TRANSFORMERS_CACHE=/home/user/.cache/huggingface/transformers \ | |
| PYTHONPATH=/home/user/app | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3.11 python3.11-venv python3.11-dev python3-pip \ | |
| git curl ca-certificates build-essential \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && ln -sf /usr/bin/python3.11 /usr/local/bin/python \ | |
| && ln -sf /usr/bin/python3.11 /usr/local/bin/python3 | |
| RUN useradd -ms /bin/bash user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:${PATH}" | |
| WORKDIR /home/user/app | |
| COPY --chown=user:user space/training/requirements.txt /home/user/app/space-training-requirements.txt | |
| RUN python -m pip install --upgrade pip && \ | |
| python -m pip install --user -r /home/user/app/space-training-requirements.txt | |
| COPY --chown=user:user . /home/user/app | |
| EXPOSE 7860 | |
| CMD ["python", "-m", "uvicorn", "space.training.app:app", "--host", "0.0.0.0", "--port", "7860"] | |