Kareman commited on
Commit
7d22da3
·
1 Parent(s): bcd37de

fix(dockerFile)

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -1
Dockerfile CHANGED
@@ -3,6 +3,8 @@ FROM python:3.10-slim
3
 
4
  # Set workdir
5
  WORKDIR /app
 
 
6
 
7
  # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
@@ -19,7 +21,10 @@ RUN pip install -r requirements.txt
19
 
20
  # ---- Pre-download MiniLM embeddings at build time ----
21
  # The model will be stored in the default Hugging Face cache (~/.cache/huggingface)
22
- RUN python -c "from langchain_huggingface import HuggingFaceEmbeddings; HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2')"
 
 
 
23
 
24
  # ---- Copy FAISS index to /tmp at runtime ----
25
  # We'll copy them from /app/faiss_index in CMD, since /tmp is the only writable location in Spaces
 
3
 
4
  # Set workdir
5
  WORKDIR /app
6
+ ENV TRANSFORMERS_CACHE=/tmp/.cache
7
+ RUN mkdir -p /tmp/.cache && chmod -R 777 /tmp/.cache
8
 
9
  # Install system dependencies
10
  RUN apt-get update && apt-get install -y \
 
21
 
22
  # ---- Pre-download MiniLM embeddings at build time ----
23
  # The model will be stored in the default Hugging Face cache (~/.cache/huggingface)
24
+ RUN python -c "from langchain_community.embeddings import HuggingFaceEmbeddings; HuggingFaceEmbeddings(model_name='sentence-transformers/all-MiniLM-L6-v2')"
25
+
26
+
27
+ COPY . .
28
 
29
  # ---- Copy FAISS index to /tmp at runtime ----
30
  # We'll copy them from /app/faiss_index in CMD, since /tmp is the only writable location in Spaces