File size: 1,190 Bytes
7577370
89a0929
7577370
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89a0929
c09c7a4
 
 
7577370
2aaaea2
8dab937
7577370
 
 
 
 
 
3856f9c
7577370
a2dbf4f
7577370
 
 
5cb0ad3
7577370
5cb0ad3
7577370
5cb0ad3
 
7577370
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
33
34
35
36
37
38
39
40
41
42
43
44
FROM nvidia/cuda:12.1.1-runtime-ubuntu22.04

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
    python3 \
    python3-pip \
    python3-distutils \
    ffmpeg \
    libsndfile1 \
    libavcodec-extra \
    gnupg \
    libcudnn9-cuda-12 \
    git && \
    update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
    rm -rf /var/lib/apt/lists/*
RUN useradd -m -u 1000 user 
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH
WORKDIR /app
ARG HF_TOKEN
ENV HUGGING_FACE_HUB_TOKEN=${HF_TOKEN}
USER user
RUN pip3 install --user --no-cache-dir "pip<24.1" 
RUN pip install --user --no-cache-dir whisperx \
     --force-reinstall

RUN pip install --user --no-cache-dir \
    torch==2.1.2 \
    torchvision==0.16.2 \
    torchaudio==2.1.2 \
    --extra-index-url https://download.pytorch.org/whl/cu121 \
    --force-reinstall
RUN pip install --user --no-cache-dir \
    pyannote.audio==3.1.1 \
    transformers==4.40.1  \
    "numpy<2"

COPY requirements.txt .
RUN pip install --user -r requirements.txt

COPY . /app 
WORKDIR /app

CMD ["python3", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]