Skip to content

Commit 162e7f9

Browse files
erickgalinkinPouyanpi
authored andcommitted
Fix: fix a bug with git to fetch models, use wget instead (NVIDIA-NeMo#981)
1 parent 96b36be commit 162e7f9

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

nemoguardrails/library/jailbreak_detection/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Use python:3.10 as the base image
22
FROM python:3.10-slim
33

4-
# Install git
5-
RUN apt-get update && apt-get install -y git gcc g++ python3-dev && apt-get clean
4+
# Install git and wget
5+
RUN apt-get update && apt-get install -y git gcc g++ python3-dev wget && apt-get clean
66

77
# Set working directory
88
WORKDIR /app
@@ -23,8 +23,8 @@ RUN python -c "from transformers import GPT2LMHeadModel, GPT2TokenizerFast; GPT2
2323

2424
# Predownload embedding-based jailbreak detection models, set environment variable for path
2525
WORKDIR /models
26-
RUN git clone git@hf.co:/nvidia/NemoGuard-JailbreakDetect
27-
ENV EMBEDDING_CLASSIFIER_PATH=/models/NemoGuard-JailbreakDetect
26+
RUN wget https://huggingface.co/nvidia/NemoGuard-JailbreakDetect/resolve/main/snowflake.pkl
27+
ENV EMBEDDING_CLASSIFIER_PATH=/models
2828

2929
# Expose a port for the server
3030
EXPOSE 1337

nemoguardrails/library/jailbreak_detection/Dockerfile-GPU

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Use nvidia/cuda:12.3.1-base-ubuntu20.04 as the base image
22
FROM nvidia/cuda:12.3.1-base-ubuntu20.04
33

4-
# Install git
5-
RUN apt-get update && apt-get install -y git gcc g++ && apt-get clean
4+
# Install git and wget
5+
RUN apt-get update && apt-get install -y git gcc g++ wget && apt-get clean
66

77
# Install python
88
RUN apt-get install python3 python3-pip python3-dev -y
@@ -29,8 +29,8 @@ ENV JAILBREAK_CHECK_DEVICE=cuda:0
2929

3030
# Predownload embedding-based jailbreak detection models, set environment variable for path
3131
WORKDIR /models
32-
RUN git clone git@hf.co:/nvidia/NemoGuard-JailbreakDetect
33-
ENV EMBEDDING_CLASSIFIER_PATH=/models/NemoGuard-JailbreakDetect
32+
RUN wget https://huggingface.co/nvidia/NemoGuard-JailbreakDetect/resolve/main/snowflake.pkl
33+
ENV EMBEDDING_CLASSIFIER_PATH=/models
3434

3535
# To use nvidia/nv-embedqa-e5-v5 model, uncomment the line below and set your API key
3636
# ENV NVIDIA_API_KEY=<your_api_key>

0 commit comments

Comments
 (0)