@@ -33,13 +33,39 @@ RUN apt-get update && \
33
33
python3.11 \
34
34
libsndfile1-dev \
35
35
ffmpeg \
36
+ gnupg2 \
37
+ wget \
36
38
&& apt-get clean autoremove --yes \
37
39
&& rm -rf /var/lib/{apt,cache,log}
38
40
39
41
# Copying only necessary files as filtered by .dockerignore
40
42
COPY . .
41
43
42
- RUN if [[ "$NEURONX" == "1" ]];then /bin/bash -c "./dockerfiles/pytorch/neuronx.sh" ;else pip install --no-cache-dir -U pip ".[torch, st, diffusers]" ;fi
44
+ RUN if [[ "$NEURONX" != "1" ]];then pip install --no-cache-dir -U pip ".[torch, st, diffusers]" ;fi
45
+
46
+ RUN if [[ "$NEURONX" == "1" ]];then . /etc/os-release && echo "deb https://apt.repos.neuron.amazonaws.com ${VERSION_CODENAME} main" > /etc/apt/sources.list.d/neuron.list;fi
47
+
48
+ RUN if [[ "$NEURONX" == "1" ]];then wget -qO - https://apt.repos.neuron.amazonaws.com/GPG-PUB-KEY-AMAZON-AWS-NEURON.PUB | apt-key add -;fi
49
+
50
+ RUN if [[ "$NEURONX" == "1" ]];then apt-get update -y && \
51
+ apt-get install -y --no-install-recommends \
52
+ aws-neuronx-dkms=2.* \
53
+ aws-neuronx-collectives=2.* \
54
+ aws-neuronx-runtime-lib=2.* \
55
+ aws-neuronx-tools=2.* && \
56
+ apt-get clean autoremove --yes && \
57
+ rm -rf /var/lib/{apt,cache,log};fi
58
+
59
+ RUN if [[ "$NEURONX" == "1" ]];then pip install -U pip && \
60
+ # Taken from optimum neuron, tgi dockerfile
61
+ pip3 install \
62
+ neuronx-cc==2.13.66.0 \
63
+ torch-neuronx==2.1.2.2.1.0 \
64
+ transformers-neuronx==0.10.0.21 \
65
+ --extra-index-url=https://pip.repos.neuron.amazonaws.com && \
66
+ pip3 install --extra-index-url=https://pip.repos.neuron.amazonaws.com optimum[neuronx,diffusers] && \
67
+ pip install ".[st,torch-neuronx]" ;fi
68
+
43
69
44
70
# copy application
45
71
COPY src/huggingface_inference_toolkit huggingface_inference_toolkit
0 commit comments