Yash Sachdeva commited on
Commit
07a4fb2
1 Parent(s): 9bf2007

quuestion_paper

Browse files
Files changed (1) hide show
  1. Dockerfile +41 -0
Dockerfile CHANGED
@@ -7,6 +7,47 @@ COPY . .
7
  WORKDIR /
8
 
9
  RUN pip install transformers
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  # Install requirements.txt
11
  RUN pip install --no-cache-dir --upgrade -r /requirements.txt
12
 
 
7
  WORKDIR /
8
 
9
  RUN pip install transformers
10
+
11
+ # Install pytorch starts
12
+
13
+ FROM nvidia/cuda:12.1.0-cudnn8-devel-ubuntu20.04
14
+ LABEL maintainer="Hugging Face"
15
+
16
+ ARG DEBIAN_FRONTEND=noninteractive
17
+
18
+ RUN apt update
19
+ RUN apt install -y git libsndfile1-dev tesseract-ocr espeak-ng python3 python3-pip ffmpeg
20
+ RUN python3 -m pip install --no-cache-dir --upgrade pip
21
+
22
+ ARG REF=main
23
+ RUN git clone https://github.com/huggingface/transformers && cd transformers && git checkout $REF
24
+
25
+ # If set to nothing, will install the latest version
26
+ ARG PYTORCH='2.1.1'
27
+ ARG TORCH_VISION=''
28
+ ARG TORCH_AUDIO=''
29
+ # Example: `cu102`, `cu113`, etc.
30
+ ARG CUDA='cu121'
31
+
32
+ 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
33
+ 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
34
+ 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
35
+
36
+ RUN python3 -m pip install --no-cache-dir -e ./transformers[dev-torch,testing,video]
37
+
38
+ RUN python3 -m pip uninstall -y tensorflow flax
39
+
40
+ RUN python3 -m pip install --no-cache-dir git+https://github.com/facebookresearch/detectron2.git pytesseract
41
+ RUN python3 -m pip install -U "itsdangerous<2.1.0"
42
+
43
+ # When installing in editable mode, `transformers` is not recognized as a package.
44
+ # this line must be added in order for python to be aware of transformers.
45
+ RUN cd transformers && python3 setup.py develop
46
+
47
+ #Install pythorch ends
48
+
49
+
50
+
51
  # Install requirements.txt
52
  RUN pip install --no-cache-dir --upgrade -r /requirements.txt
53