seanpedrickcase commited on
Commit
97913c4
1 Parent(s): 00db72b

Finally managed to enforce cpu torch install in Dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +5 -4
  2. requirements_aws.txt +6 -2
Dockerfile CHANGED
@@ -12,12 +12,13 @@ RUN mkdir -p /model/rep /model/embed /install
12
 
13
  WORKDIR /src
14
 
15
- # Copy requirements file and install dependencies
16
  COPY requirements_aws.txt .
17
- RUN pip install --no-cache-dir --target=/install -r requirements_aws.txt
18
 
19
- # Install sentence-transformers without dependencies
20
- RUN pip install --no-cache-dir sentence-transformers==3.0.1 --no-deps
 
 
21
 
22
  # Add /install to the PYTHONPATH
23
  ENV PYTHONPATH="/install:${PYTHONPATH}"
 
12
 
13
  WORKDIR /src
14
 
15
+ # Copy requirements file and install dependencies. Sentence transformers and Bertopic are installed without dependencies so that torch is not reinstalled.
16
  COPY requirements_aws.txt .
 
17
 
18
+ RUN pip install torch==2.4.0+cpu --index-url https://download.pytorch.org/whl/cpu \
19
+ && pip install --no-cache-dir sentence-transformers==3.0.1 --no-deps \
20
+ && pip install --no-cache-dir bertopic==0.16.2 --no-deps \
21
+ && pip install --no-cache-dir --target=/install -r requirements_aws.txt
22
 
23
  # Add /install to the PYTHONPATH
24
  ENV PYTHONPATH="/install:${PYTHONPATH}"
requirements_aws.txt CHANGED
@@ -1,6 +1,9 @@
1
- torch==2.4.0 --index-url https://download.pytorch.org/whl/cpu
 
 
 
 
2
  boto3==1.34.158
3
- bertopic==0.16.2
4
  spacy==3.7.5
5
  en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1.tar.gz
6
  gradio>=4.26.0
@@ -11,4 +14,5 @@ presidio_analyzer==2.2.354
11
  presidio_anonymizer==2.2.354
12
  scipy==1.11.4
13
  polars==0.20.6
 
14
  numpy==1.26.4
 
1
+ hdbscan==0.8.38.post1
2
+ pandas==2.2.2
3
+ plotly==5.23.0
4
+ scikit-learn==1.5.1
5
+ umap-learn==0.5.6
6
  boto3==1.34.158
 
7
  spacy==3.7.5
8
  en_core_web_sm @ https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.7.1/en_core_web_sm-3.7.1.tar.gz
9
  gradio>=4.26.0
 
14
  presidio_anonymizer==2.2.354
15
  scipy==1.11.4
16
  polars==0.20.6
17
+ transformers==4.44.0
18
  numpy==1.26.4