tharu22 commited on
Commit
7eb8591
·
1 Parent(s): cad9748
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. main.py +1 -1
Dockerfile CHANGED
@@ -1,11 +1,11 @@
1
  # Use an official Python base image
2
- FROM python:3.10-slim
3
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
- # Set environment variable for Hugging Face cache directory
8
- ENV TRANSFORMERS_CACHE="/app/cache"
9
 
10
  # Copy the requirements file
11
  COPY requirements.txt .
 
1
  # Use an official Python base image
2
+ FROM python:3.11-slim
3
 
4
  # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Set Hugging Face cache directory to a writable location
8
+ ENV HF_HOME="/tmp/huggingface"
9
 
10
  # Copy the requirements file
11
  COPY requirements.txt .
main.py CHANGED
@@ -4,7 +4,7 @@ from sentence_transformers import SentenceTransformer
4
  import numpy as np
5
 
6
  import os
7
- os.environ["TRANSFORMERS_CACHE"] = "/app/cache"
8
  # Initialize FastAPI app
9
  app = FastAPI()
10
 
 
4
  import numpy as np
5
 
6
  import os
7
+ os.environ["HF_HOME"] = "/tmp/huggingface"
8
  # Initialize FastAPI app
9
  app = FastAPI()
10