2022-03-15 00:37:20 +08:00
|
|
|
FROM nvidia/cuda:11.2.2-cudnn8-devel-ubuntu20.04
|
2022-02-24 04:48:19 +08:00
|
|
|
LABEL maintainer="Hugging Face"
|
|
|
|
|
|
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
|
|
|
RUN apt update
|
2022-06-08 17:45:10 +08:00
|
|
|
RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg git-lfs
|
|
|
|
RUN git lfs install
|
2022-02-24 04:48:19 +08:00
|
|
|
RUN python3 -m pip install --no-cache-dir --upgrade pip
|
|
|
|
|
2022-03-25 21:12:23 +08:00
|
|
|
ARG REF=main
|
2022-02-24 04:48:19 +08:00
|
|
|
RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
|
|
|
|
RUN python3 -m pip install --no-cache-dir -e ./transformers[dev,onnxruntime]
|
|
|
|
|
2022-06-07 17:53:05 +08:00
|
|
|
RUN python3 -m pip install --no-cache-dir -U torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu113
|
|
|
|
RUN python3 -m pip install --no-cache-dir -U tensorflow
|
2022-02-24 04:48:19 +08:00
|
|
|
RUN python3 -m pip uninstall -y flax jax
|
2022-06-07 17:53:05 +08:00
|
|
|
|
|
|
|
RUN python3 -m pip install --no-cache-dir torch-scatter -f https://data.pyg.org/whl/torch-$(python3 -c "from torch import version; print(version.__version__.split('+')[0])")+cu113.html
|
|
|
|
RUN python3 -m pip install --no-cache-dir intel_extension_for_pytorch==$(python3 -c "from torch import version; print(version.__version__.split('+')[0])")+cpu -f https://software.intel.com/ipex-whl-stable
|
|
|
|
|
2022-02-24 04:48:19 +08:00
|
|
|
RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract https://github.com/kpu/kenlm/archive/master.zip
|
|
|
|
RUN python3 -m pip install -U "itsdangerous<2.1.0"
|
|
|
|
|
2022-05-14 01:47:09 +08:00
|
|
|
RUN python3 -m pip install --no-cache-dir git+https://github.com/huggingface/accelerate@main#egg=accelerate
|
|
|
|
|
2022-02-24 04:48:19 +08:00
|
|
|
# When installing in editable mode, `transformers` is not recognized as a package.
|
|
|
|
# this line must be added in order for python to be aware of transformers.
|
|
|
|
RUN cd transformers && python3 setup.py develop
|