From 96f4be4922f5efb7501c4c5dc3d4bc8b021f5039 Mon Sep 17 00:00:00 2001 From: Arthur Zucker Date: Mon, 29 Apr 2024 13:53:19 +0200 Subject: [PATCH] [push-ci-image] reduce even further --- docker/torch-light.dockerfile | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/docker/torch-light.dockerfile b/docker/torch-light.dockerfile index 56c30c48cbb60b..8e81b9c7e26ccb 100644 --- a/docker/torch-light.dockerfile +++ b/docker/torch-light.dockerfile @@ -1,27 +1,10 @@ FROM python:3.10-slim ENV PYTHONDONTWRITEBYTECODE=1 USER root -RUN apt-get update && apt-get install -y libsndfile1-dev espeak-ng time git -RUN apt-get install -y g++ cmake +RUN apt-get update && apt-get install -y --no-install-recommends libsndfile1-dev espeak-ng time git g++ cmake && rm -rf /var/lib/apt/lists/* ENV VIRTUAL_ENV=/usr/local -RUN pip --no-cache-dir install uv -RUN uv venv -RUN uv pip install --no-cache-dir -U pip setuptools -RUN uv pip install --no-cache-dir "fsspec>=2023.5.0,<2023.10.0" +RUN pip --no-cache-dir install uv && uv venv && uv pip install --no-cache-dir -U pip setuptools RUN pip install --no-cache-dir 'torch' 'torchvision' 'torchaudio' --index-url https://download.pytorch.org/whl/cpu -RUN uv pip install accelerate soundfile -RUN uv pip install --no-cache-dir "transformers[sklearn,sentencepiece,vision,timm,testing]" - - -RUN pip uninstall -y transformers -RUN apt-get clean && rm -rf /var/lib/apt/lists/* -RUN pip cache remove "nvidia-*" -RUN pip uninstall -y `pip freeze | grep "nvidia-*"` || true -RUN pip uninstall -y `pip freeze | grep "triton-*"` || true - - - -RUN pip cache remove triton -RUN apt-get --purge remove "*nvidia*" || true -RUN apt-get autoremove -RUN apt-get autoclean \ No newline at end of file +RUN uv pip install --no-cache-dir accelerate soundfile"fsspec>=2023.5.0,<2023.10.0" "transformers[sklearn,sentencepiece,vision,timm,testing]" +RUN pip uninstall -y transformers && apt-get clean || apt-get -y --purge remove "*nvidia*" || apt-get autoremove || apt-get autoclean +RUN pip cache remove "nvidia-*" ||pip uninstall -y `pip freeze | grep "nvidia-*"` || pip uninstall -y `pip freeze | grep "triton-*"` || pip cache remove triton || true \ No newline at end of file