Skip to content

Commit bf3260a

Browse files
committed
Fix kenlm installation issue (more details in comment)
1 parent b1f717d commit bf3260a

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

dockerfiles/pytorch/Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ RUN apt-get update && \
1616
apt-get install -y \
1717
build-essential \
1818
bzip2 \
19+
cmake \
1920
curl \
2021
git \
2122
git-lfs \
2223
tar \
2324
gcc \
2425
g++ \
25-
cmake \
2626
libprotobuf-dev \
2727
protobuf-compiler \
2828
python3.11 \
@@ -44,14 +44,21 @@ RUN curl -O https://bootstrap.pypa.io/get-pip.py && \
4444
python get-pip.py && \
4545
rm get-pip.py
4646

47-
# install wheel and setuptools
47+
# Upgrade pip
48+
RUN pip install --no-cache-dir --upgrade pip
49+
50+
# Due to an error affecting kenlm and cmake (see https://github.com/kpu/kenlm/pull/464)
51+
# Also see the transformers patch for it https://github.com/huggingface/transformers/pull/37091
52+
RUN pip install --no-cache-dir kenlm@git+https://github.com/kpu/kenlm@ba83eafdce6553addd885ed3da461bb0d60f8df7
53+
54+
# Install wheel and setuptools
4855
RUN pip install --no-cache-dir --upgrade pip ".[torch,st,diffusers]"
4956

50-
# copy application
57+
# Copy application
5158
COPY src/huggingface_inference_toolkit huggingface_inference_toolkit
5259
COPY src/huggingface_inference_toolkit/webservice_starlette.py webservice_starlette.py
5360

54-
# copy entrypoint and change permissions
61+
# Copy entrypoint and change permissions
5562
COPY --chmod=0755 scripts/entrypoint.sh entrypoint.sh
5663

5764
ENTRYPOINT ["bash", "-c", "./entrypoint.sh"]

0 commit comments

Comments
 (0)