bla commited on
Commit
7545345
·
verified ·
1 Parent(s): 6952f34

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -12
Dockerfile CHANGED
@@ -1,24 +1,28 @@
1
- # Use Python 3.12 as the base image
2
- FROM python:3.12-slim
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  ffmpeg \
7
  git \
8
  build-essential \
 
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
  # Create a non-root user
12
  RUN useradd -m -u 1000 user
13
  WORKDIR /app
14
 
15
- # Install Python dependencies in stages
16
  RUN pip install --no-cache-dir --upgrade pip && \
17
  # Install PyTorch first
18
  pip install --no-cache-dir \
19
- torch \
20
- torchvision && \
21
- # Then install other dependencies
 
 
 
22
  pip install --no-cache-dir \
23
  git+https://github.com/huggingface/transformers \
24
  accelerate \
@@ -27,12 +31,7 @@ RUN pip install --no-cache-dir --upgrade pip && \
27
  uvicorn[standard] \
28
  python-multipart \
29
  pillow \
30
- pydantic && \
31
- # Finally install autoawq
32
- # Install autoawq from wheel
33
- pip3 install --no-cache-dir \
34
- --find-links https://github.com/casper-hansen/AutoAWQ/releases/download/v0.2.8/ \
35
- autoawq==0.2.8
36
 
37
  # Copy application files
38
  COPY --chown=user:user . /app
 
1
+ # Use Python 3.10 as the base image
2
+ FROM python:3.10-slim
3
 
4
  # Install system dependencies
5
  RUN apt-get update && apt-get install -y \
6
  ffmpeg \
7
  git \
8
  build-essential \
9
+ ninja-build \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
  # Create a non-root user
13
  RUN useradd -m -u 1000 user
14
  WORKDIR /app
15
 
16
+ # Install Python dependencies in correct order
17
  RUN pip install --no-cache-dir --upgrade pip && \
18
  # Install PyTorch first
19
  pip install --no-cache-dir \
20
+ torch==2.1.0 \
21
+ torchvision==0.16.0 \
22
+ ninja && \
23
+ # Install AutoAWQ
24
+ pip install --no-cache-dir autoawq && \
25
+ # Install other dependencies
26
  pip install --no-cache-dir \
27
  git+https://github.com/huggingface/transformers \
28
  accelerate \
 
31
  uvicorn[standard] \
32
  python-multipart \
33
  pillow \
34
+ pydantic
 
 
 
 
 
35
 
36
  # Copy application files
37
  COPY --chown=user:user . /app