First commit of files
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
FROM python:3.10-bookworm
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# install lib required for pyaudio
|
||||
RUN apt update && apt install -y portaudio19-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# update pip to support for whl.metadata -> less downloading
|
||||
RUN pip install --no-cache-dir -U "pip>=24"
|
||||
|
||||
# create a working directory
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
# install the requirements for running the whisper-live server
|
||||
COPY requirements/server.txt /app/
|
||||
RUN pip install --no-cache-dir -r server.txt && rm server.txt
|
||||
|
||||
# make the paths of the nvidia libs installed as wheels visible. equivalent to:
|
||||
# export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
|
||||
ENV LD_LIBRARY_PATH="/usr/local/lib/python3.10/site-packages/nvidia/cublas/lib:/usr/local/lib/python3.10/site-packages/nvidia/cudnn/lib"
|
||||
|
||||
EXPOSE ${WHISPERLIVE_PORT}
|
||||
|
||||
COPY whisper_live /app/whisper_live
|
||||
COPY models /app/models
|
||||
COPY run_server.py /app
|
||||
|
||||
ARG WHISPERLIVE_PORT
|
||||
ENV WHISPERLIVE_PORT=${WHISPERLIVE_PORT}
|
||||
|
||||
ARG FASTERWHISPER_MODEL
|
||||
ENV FASTERWHISPER_MODEL=${FASTERWHISPER_MODEL}
|
||||
|
||||
CMD python3 run_server.py --port $WHISPERLIVE_PORT --backend faster_whisper --faster_whisper_custom_model_path /app/models/$FASTERWHISPER_MODEL
|
||||
@@ -0,0 +1,25 @@
|
||||
FROM python:3.10-bookworm
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# install lib required for pyaudio
|
||||
RUN apt update && apt install -y portaudio19-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# update pip to support for whl.metadata -> less downloading
|
||||
RUN pip install --no-cache-dir -U "pip>=24"
|
||||
|
||||
# create a working directory
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
# install pytorch, but without the nvidia-libs that are only necessary for gpu
|
||||
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
|
||||
|
||||
# install the requirements for running the whisper-live server
|
||||
COPY requirements/server.txt /app/
|
||||
RUN pip install --no-cache-dir -r server.txt && rm server.txt
|
||||
|
||||
COPY whisper_live /app/whisper_live
|
||||
COPY run_server.py /app
|
||||
|
||||
CMD ["python", "run_server.py"]
|
||||
@@ -0,0 +1,26 @@
|
||||
FROM python:3.10-bookworm
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# install lib required for pyaudio
|
||||
RUN apt update && apt install -y portaudio19-dev && apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# update pip to support for whl.metadata -> less downloading
|
||||
RUN pip install --no-cache-dir -U "pip>=24"
|
||||
|
||||
# create a working directory
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
# install the requirements for running the whisper-live server
|
||||
COPY requirements/server.txt /app/
|
||||
RUN pip install --no-cache-dir -r server.txt && rm server.txt
|
||||
|
||||
# make the paths of the nvidia libs installed as wheels visible. equivalent to:
|
||||
# export LD_LIBRARY_PATH=`python3 -c 'import os; import nvidia.cublas.lib; import nvidia.cudnn.lib; print(os.path.dirname(nvidia.cublas.lib.__file__) + ":" + os.path.dirname(nvidia.cudnn.lib.__file__))'`
|
||||
ENV LD_LIBRARY_PATH="/usr/local/lib/python3.10/site-packages/nvidia/cublas/lib:/usr/local/lib/python3.10/site-packages/nvidia/cudnn/lib"
|
||||
|
||||
COPY whisper_live /app/whisper_live
|
||||
COPY run_server.py /app
|
||||
|
||||
CMD ["python", "run_server.py"]
|
||||
@@ -0,0 +1,37 @@
|
||||
FROM nvidia/cuda:12.2.2-cudnn8-runtime-ubuntu22.04
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Remove any third-party apt sources to avoid issues with expiring keys.
|
||||
RUN rm -f /etc/apt/sources.list.d/*.list
|
||||
|
||||
# Install some basic utilities.
|
||||
RUN apt-get update && apt-get install -y \
|
||||
python3.10 python3-pip openmpi-bin libopenmpi-dev git wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN pip3 install --no-cache-dir -U tensorrt_llm==0.9.0 --extra-index-url https://pypi.nvidia.com
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN git clone -b v0.9.0 --depth 1 https://github.com/NVIDIA/TensorRT-LLM.git && \
|
||||
mv TensorRT-LLM/examples ./TensorRT-LLM-examples && \
|
||||
rm -rf TensorRT-LLM
|
||||
|
||||
COPY assets/ ./assets
|
||||
RUN wget -nc -P assets/ https://raw.githubusercontent.com/openai/whisper/main/whisper/assets/mel_filters.npz
|
||||
|
||||
COPY scripts/setup.sh ./
|
||||
RUN apt update && bash setup.sh && rm setup.sh
|
||||
|
||||
COPY requirements/server.txt .
|
||||
RUN pip install --no-cache-dir -r server.txt && rm server.txt
|
||||
|
||||
COPY whisper_live ./whisper_live
|
||||
COPY scripts/build_whisper_tensorrt.sh .
|
||||
COPY run_server.py .
|
||||
|
||||
# Build the TensorRT engine
|
||||
RUN bash build_whisper_tensorrt.sh /app/TensorRT-LLM-examples small.en
|
||||
|
||||
# Set the command to run the server
|
||||
CMD ["python3", "run_server.py", "--port", "9090", "--backend", "tensorrt", "--trt_model_path", "/app/TensorRT-LLM-examples/whisper/whisper_small_en"]
|
||||
@@ -0,0 +1,28 @@
|
||||
services:
|
||||
whisperlive-server:
|
||||
runtime: nvidia
|
||||
build:
|
||||
context: ./backend/whisperlive/server
|
||||
dockerfile: Dockerfile.tensorrt # Override to use Dockerfile.tensorrt
|
||||
args:
|
||||
WHISPERLIVE_PORT: ${WHISPERLIVE_PORT}
|
||||
env_file:
|
||||
- ./.env
|
||||
environment:
|
||||
WHISPERLIVE_PORT: ${WHISPERLIVE_PORT}
|
||||
NVIDIA_VISIBLE_DEVICES: all
|
||||
NVIDIA_DRIVER_CAPABILITIES: compute,utility
|
||||
volumes:
|
||||
- data_volume:/data
|
||||
deploy:
|
||||
resources:
|
||||
reservations:
|
||||
devices:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities: [gpu]
|
||||
ports:
|
||||
- ${WHISPERLIVE_PORT}:${WHISPERLIVE_PORT}
|
||||
networks:
|
||||
- app-network
|
||||
|
||||
Reference in New Issue
Block a user