JPBianchi commited on
Commit
0d49e0f
·
1 Parent(s): e1eae32

added guardrails hub in dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -1
Dockerfile CHANGED
@@ -9,11 +9,21 @@ ENV ENVIRONMENT=dev
9
 
10
  COPY ./app /app
11
  WORKDIR .
12
- RUN mkdir /data
 
13
 
14
  RUN pip install --no-cache-dir --upgrade -r app/requirements.txt
15
  # ^ no caching of the packages to save space
16
 
 
 
 
 
 
 
 
 
 
17
  # RUN python -c "import nltk; nltk.download('stopwords')"
18
  # ^ to fix runtime error, see https://github.com/run-llama/llama_index/issues/10681
19
  # it didn't work, I had to do chmod below (as also suggested in the article)
 
9
 
10
  COPY ./app /app
11
  WORKDIR .
12
+ RUN mkdir -p data
13
+ RUN mkdir -p assets/data
14
 
15
  RUN pip install --no-cache-dir --upgrade -r app/requirements.txt
16
  # ^ no caching of the packages to save space
17
 
18
+ # pip install guardrails-ai first
19
+ # https://huggingface.co/docs/hub/spaces-sdks-docker#secrets
20
+ RUN --mount=type=secret,id=GUARDRAILS_TOKEN,mode=0444,required=true \
21
+ guardrails configure --token $(cat /run/secrets/GUARDRAILS_TOKEN) --no-metrics True
22
+ RUN guardrails hub install hub://guardrails/regex_match
23
+ RUN guardrails hub install hub://guardrails/toxic_language
24
+ RUN guardrails hub install hub://guardrails/detect_pii
25
+ RUN guardrails hub install hub://guardrails/qa_relevance_llm_eval
26
+
27
  # RUN python -c "import nltk; nltk.download('stopwords')"
28
  # ^ to fix runtime error, see https://github.com/run-llama/llama_index/issues/10681
29
  # it didn't work, I had to do chmod below (as also suggested in the article)