@@ -22,31 +22,26 @@ RUN apt-get update && apt-get install -y git
22
22
# Install gcc/g++ for annoy
23
23
RUN apt-get install -y gcc g++
24
24
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
-
29
25
# Copy and install NeMo Guardrails
30
26
WORKDIR /nemoguardrails
31
27
COPY . /nemoguardrails
32
28
RUN pip install -e .[all]
33
29
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
37
32
38
- # Make port 800 available to the world outside this container
33
+ # Make port 8000 available to the world outside this container
39
34
EXPOSE 8000
40
35
41
- # We copy the topical/moderation/etc. examples
36
+ # We copy the example bot configurations
42
37
WORKDIR /config
43
38
COPY ./examples/bots /config
44
39
45
40
# Run app.py when the container launches
46
41
WORKDIR /nemoguardrails
47
42
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'); "
50
45
51
46
# Run this so that everything is initialized
52
47
RUN nemoguardrails --help
0 commit comments