User commited on
Commit
72832ac
·
1 Parent(s): 23fd46b

added sub directory and changed docker

Browse files
Files changed (2) hide show
  1. Dockerfile +1 -0
  2. app.py +4 -1
Dockerfile CHANGED
@@ -7,6 +7,7 @@ COPY . /app
7
 
8
  # Install dependencies
9
  RUN pip install --no-cache-dir -r requirements.txt
 
10
 
11
  # Expose the port your FastAPI app runs on (e.g. 7860)
12
  EXPOSE 7860
 
7
 
8
  # Install dependencies
9
  RUN pip install --no-cache-dir -r requirements.txt
10
+ RUN mkdir -p /app/.cache && chmod -R 777 /app/.cache
11
 
12
  # Expose the port your FastAPI app runs on (e.g. 7860)
13
  EXPOSE 7860
app.py CHANGED
@@ -19,7 +19,10 @@ from langchain_core.runnables import RunnablePassthrough
19
 
20
  # FastAPI initialization
21
  app = FastAPI(title="RAG API", description="Simple API for RAG-based question answering")
22
- os.environ["HF_DATASETS_CACHE"] = "/tmp/.hf_datasets_cache"
 
 
 
23
 
24
  # Global variables
25
  persist_directory = "./chroma_db"
 
19
 
20
  # FastAPI initialization
21
  app = FastAPI(title="RAG API", description="Simple API for RAG-based question answering")
22
+ os.environ["HF_HOME"] = "./.cache"
23
+ os.environ["HF_DATASETS_CACHE"] = "./.cache/datasets"
24
+ os.environ["TRANSFORMERS_CACHE"] = "./.cache/transformers"
25
+
26
 
27
  # Global variables
28
  persist_directory = "./chroma_db"