Marroco93 commited on
Commit
1f94144
1 Parent(s): 0b9c508

no message

Browse files
Files changed (2) hide show
  1. Dockerfile +8 -0
  2. copy.py +1 -1
Dockerfile CHANGED
@@ -4,6 +4,14 @@ WORKDIR /code
4
 
5
  COPY ./requirements.txt /code/requirements.txt
6
 
 
 
 
 
 
 
 
 
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
9
  # Set an environment variable for the NLTK data directory
 
4
 
5
  COPY ./requirements.txt /code/requirements.txt
6
 
7
+ # Set the cache directory for transformers and Hugging Face Hub within the container
8
+ ENV TRANSFORMERS_CACHE=/code/cache/huggingface/transformers
9
+ ENV HF_HOME=/code/cache/huggingface/hub
10
+
11
+ # Create the cache directories
12
+ RUN mkdir -p $TRANSFORMERS_CACHE
13
+ RUN mkdir -p $HF_HOME
14
+
15
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
16
 
17
  # Set an environment variable for the NLTK data directory
copy.py CHANGED
@@ -16,7 +16,7 @@ app = FastAPI()
16
  # Initialize the InferenceClient with your model
17
  client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2")
18
 
19
- summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
20
 
21
 
22
  class Item(BaseModel):
 
16
  # Initialize the InferenceClient with your model
17
  client = InferenceClient("mistralai/Mistral-7B-Instruct-v0.2")
18
 
19
+ # summarizer = pipeline("summarization", model="sshleifer/distilbart-cnn-12-6")
20
 
21
 
22
  class Item(BaseModel):