File size: 902 Bytes
aceb54a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
# you will also find guides on how best to write your Dockerfile

FROM nvidia/cuda:12.3.2-cudnn9-devel-ubuntu22.04

RUN apt-get update && apt-get upgrade -y 
RUN apt-get install -y python3-pip python3-dev
RUN apt-get update && apt-get install ffmpeg libsm6 libxext6  -y
RUN apt-get install -y git
RUN pip3 install --upgrade pip
RUN pip3 install packaging
RUN pip install --no-cache-dir numpy==1.23.5

RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:$PATH"

WORKDIR /app

COPY --chown=user ./requirements.txt requirements.txt

# Install torch first
RUN pip install --no-cache-dir torch==2.1.2

# Now install the rest of the packages
RUN pip install --no-cache-dir --upgrade -r requirements.txt
RUN pip install flash_attn

COPY --chown=user . /app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]