vicliv commited on
Commit
a635394
·
1 Parent(s): c3e4914

first commit

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -6
  2. app/requirements.txt +0 -1
Dockerfile CHANGED
@@ -1,6 +1,7 @@
1
  FROM python:3.11-slim
2
 
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
 
4
  libgl1 \
5
  libglib2.0-0 \
6
  && rm -rf /var/lib/apt/lists/*
@@ -8,16 +9,12 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
8
  WORKDIR /code
9
 
10
  COPY app/requirements.txt /code/requirements.txt
11
- RUN pip install --no-cache-dir --extra-index-url https://download.pytorch.org/whl/cpu \
12
- -r /code/requirements.txt
13
 
14
  ENV HF_HOME=/code/.hf-cache
15
  ENV PYTHONUNBUFFERED=1
16
 
17
- RUN python -c "from transformers import AutoImageProcessor, AutoModelForImageClassification; \
18
- AutoImageProcessor.from_pretrained('microsoft/swinv2-base-patch4-window16-256', cache_dir='/code/.hf-cache'); \
19
- AutoModelForImageClassification.from_pretrained('microsoft/swinv2-base-patch4-window16-256', cache_dir='/code/.hf-cache')"
20
-
21
  COPY model.safetensors /code/model.safetensors
22
  COPY app /code/app
23
 
 
1
  FROM python:3.11-slim
2
 
3
  RUN apt-get update && apt-get install -y --no-install-recommends \
4
+ git \
5
  libgl1 \
6
  libglib2.0-0 \
7
  && rm -rf /var/lib/apt/lists/*
 
9
  WORKDIR /code
10
 
11
  COPY app/requirements.txt /code/requirements.txt
12
+ RUN pip install --no-cache-dir torch==2.4.1 --index-url https://download.pytorch.org/whl/cpu \
13
+ && pip install --no-cache-dir -r /code/requirements.txt
14
 
15
  ENV HF_HOME=/code/.hf-cache
16
  ENV PYTHONUNBUFFERED=1
17
 
 
 
 
 
18
  COPY model.safetensors /code/model.safetensors
19
  COPY app /code/app
20
 
app/requirements.txt CHANGED
@@ -1,6 +1,5 @@
1
  fastapi==0.115.0
2
  uvicorn[standard]==0.30.6
3
- torch==2.4.1
4
  transformers==4.45.2
5
  safetensors==0.4.5
6
  Pillow==10.4.0
 
1
  fastapi==0.115.0
2
  uvicorn[standard]==0.30.6
 
3
  transformers==4.45.2
4
  safetensors==0.4.5
5
  Pillow==10.4.0