abhikamuni commited on
Commit
c4557af
·
verified ·
1 Parent(s): 567f720
Files changed (1) hide show
  1. Dockerfile +15 -8
Dockerfile CHANGED
@@ -1,11 +1,15 @@
 
1
  FROM python:3.11-slim
2
 
3
  WORKDIR /code
4
 
5
- # Set the env vars for both runtime and buildtime
6
- # This tells the RUN command below where to save the model
 
 
7
  ENV HF_HOME="/code/.cache/huggingface"
8
- ENV DSPY_CACHE_DIR="/tmp/.dspy_cache"
 
9
 
10
  RUN apt-get update && apt-get install -y --no-install-recommends \
11
  build-essential \
@@ -14,18 +18,21 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
14
  COPY ./requirements.txt /code/requirements.txt
15
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
 
17
- # --- START: PRE-BAKE MODEL FIX (WITH PERMISSIONS) ---
 
 
18
 
19
- # 1. Create the cache directory
20
  RUN mkdir -p $HF_HOME
21
 
22
- # 2. THIS IS THE FIX: Give all users full read/write/execute permissions
 
23
  RUN chmod -R 777 $HF_HOME
24
 
25
- # 3. Now, pre-bake the model. It will save to the directory we just made.
 
26
  RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
27
 
28
- # --- END: PRE-BAKE MODEL FIX ---
29
 
30
  COPY ./app /code/app
31
 
 
1
+
2
  FROM python:3.11-slim
3
 
4
  WORKDIR /code
5
 
6
+ #Set the env vars for both runtime and buildtime
7
+
8
+ #This tells the RUN command below where to save the model
9
+
10
  ENV HF_HOME="/code/.cache/huggingface"
11
+
12
+ #--- REMOVED DSPY ENV VAR ---
13
 
14
  RUN apt-get update && apt-get install -y --no-install-recommends \
15
  build-essential \
 
18
  COPY ./requirements.txt /code/requirements.txt
19
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
20
 
21
+ #--- START: PRE-BAKE MODEL FIX (WITH PERMISSIONS) ---
22
+
23
+ #1. Create the cache directory
24
 
 
25
  RUN mkdir -p $HF_HOME
26
 
27
+ #2. Give all users full read/write/execute permissions
28
+
29
  RUN chmod -R 777 $HF_HOME
30
 
31
+ #3. Now, pre-bake the model. It will save to the directory we just made.
32
+
33
  RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
34
 
35
+ #--- END: PRE-BAKE MODEL FIX ---
36
 
37
  COPY ./app /code/app
38