|
|
FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu22.04 |
|
|
LABEL maintainer="Hugging Face" |
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive |
|
|
|
|
|
|
|
|
SHELL ["sh", "-lc"] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ARG PYTORCH='2.6.0' |
|
|
|
|
|
ARG INTEL_TORCH_EXT='2.3.0' |
|
|
|
|
|
ARG CUDA='cu121' |
|
|
|
|
|
ENV DISABLE_KERNEL_MAPPING=1 |
|
|
|
|
|
RUN apt update |
|
|
RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg git-lfs |
|
|
RUN git lfs install |
|
|
RUN python3 -m pip install --no-cache-dir --upgrade pip |
|
|
|
|
|
ARG REF=main |
|
|
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir -U tensorflow==2.13 protobuf==3.20.3 "tensorflow_text<2.16" "tensorflow_probability<0.22" && python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime] && [ ${#PYTORCH} -gt 0 -a "$PYTORCH" != "pre" ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; echo "export VERSION='$VERSION'" >> ~/.profile && echo torch=$VERSION && [ "$PYTORCH" != "pre" ] && python3 -m pip install --no-cache-dir -U $VERSION torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/$CUDA || python3 -m pip install --no-cache-dir -U --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/$CUDA |
|
|
|
|
|
RUN python3 -m pip uninstall -y flax jax |
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir intel_extension_for_pytorch==$INTEL_TORCH_EXT -f https://developer.intel.com/ipex-whl-stable-cpu |
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract |
|
|
RUN python3 -m pip install -U "itsdangerous<2.1.0" |
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main |
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/peft@main |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/optimum@main |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir av==9.2.0 |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir bitsandbytes |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir quanto |
|
|
|
|
|
|
|
|
|
|
|
RUN python3 -m pip uninstall -y ninja |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir natten==0.17.4+torch250cu121 -f https://shi-labs.com/natten/wheels |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir python-Levenshtein |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir g2p-en |
|
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir einops |
|
|
|
|
|
|
|
|
|
|
|
RUN cd transformers && python3 setup.py develop |
|
|
|