Skip to content

Commit 5786f56

Browse files
committed
Update Dockerfile to remove SentenceTransformers-related install commands.
1 parent f76d1c5 commit 5786f56

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

Dockerfile

+6-11
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,26 @@ RUN apt-get update && apt-get install -y git
2222
# Install gcc/g++ for annoy
2323
RUN apt-get install -y gcc g++
2424

25-
# We install this separately to speed up the rebuilding of images when dependencies change.
26-
# This installs pytorch and co.
27-
RUN pip install sentence-transformers==2.2.2
28-
2925
# Copy and install NeMo Guardrails
3026
WORKDIR /nemoguardrails
3127
COPY . /nemoguardrails
3228
RUN pip install -e .[all]
3329

34-
# https://stackoverflow.com/questions/77290003/segmentation-fault-when-using-sentencetransformer-inside-docker-container
35-
# Workaround for a bug when running on Apple M1/M2
36-
RUN pip install torch==2.0.*
30+
# Remove the PIP cache
31+
RUN rm -rf /root/.cache/pip
3732

38-
# Make port 800 available to the world outside this container
33+
# Make port 8000 available to the world outside this container
3934
EXPOSE 8000
4035

41-
# We copy the topical/moderation/etc. examples
36+
# We copy the example bot configurations
4237
WORKDIR /config
4338
COPY ./examples/bots /config
4439

4540
# Run app.py when the container launches
4641
WORKDIR /nemoguardrails
4742

48-
# Download the transformer model
49-
RUN python -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')"
43+
# Download the `all-MiniLM-L6-v2` model
44+
RUN python -c "from fastembed.embedding import FlagEmbedding; FlagEmbedding('sentence-transformers/all-MiniLM-L6-v2');"
5045

5146
# Run this so that everything is initialized
5247
RUN nemoguardrails --help

0 commit comments

Comments
 (0)