woods-today commited on
Commit
f2a459d
1 Parent(s): 080a8fc

Working on it

Browse files
Files changed (1) hide show
  1. Dockerfile +33 -4
Dockerfile CHANGED
@@ -1,8 +1,37 @@
1
  # FROM python:3.7-slim
2
- FROM nvidia/cuda:12.2.0-runtime-ubuntu20.04
3
- FROM nvcr.io/nvidia/pytorch:22.08-py3
4
- RUN nvcc -V
5
- RUN nvidia-smi
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  WORKDIR /code
8
 
 
1
  # FROM python:3.7-slim
2
+
3
+ FROM nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04
4
+ LABEL maintainer="Hugging Face"
5
+
6
+ ARG DEBIAN_FRONTEND=noninteractive
7
+
8
+ RUN apt update
9
+ RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
10
+ RUN python3 -m pip install --no-cache-dir --upgrade pip
11
+
12
+ ARG REF=main
13
+ RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
14
+ RUN python3 -m pip install --no-cache-dir -e ./transformers[dev-torch,testing,video]
15
+
16
+ # If set to nothing, will install the latest version
17
+ ARG PYTORCH='2.0.1'
18
+ ARG TORCH_VISION=''
19
+ ARG TORCH_AUDIO=''
20
+ # Example: `cu102`, `cu113`, etc.
21
+ ARG CUDA='cu118'
22
+
23
+ RUN [ ${#PYTORCH} -gt 0 ] && VERSION='torch=='$PYTORCH'.*' || VERSION='torch'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
24
+ RUN [ ${#TORCH_VISION} -gt 0 ] && VERSION='torchvision=='TORCH_VISION'.*' || VERSION='torchvision'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
25
+ RUN [ ${#TORCH_AUDIO} -gt 0 ] && VERSION='torchaudio=='TORCH_AUDIO'.*' || VERSION='torchaudio'; python3 -m pip install --no-cache-dir -U $VERSION --extra-index-url https://download.pytorch.org/whl/$CUDA
26
+
27
+ RUN python3 -m pip uninstall -y tensorflow flax
28
+
29
+ RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract
30
+ RUN python3 -m pip install -U "itsdangerous<2.1.0"
31
+
32
+ # When installing in editable mode, `transformers` is not recognized as a package.
33
+ # this line must be added in order for python to be aware of transformers.
34
+ RUN cd transformers && python3 setup.py develop
35
 
36
  WORKDIR /code
37