mirror of
https://github.com/bellingcat/whisperbox-transcribe.git
synced 2026-06-11 21:18:36 +03:00
feat: add gpu support
This commit is contained in:
39
worker.gpu.Dockerfile
Normal file
39
worker.gpu.Dockerfile
Normal file
@@ -0,0 +1,39 @@
|
||||
# TODO: clean up lol
|
||||
FROM nvidia/cuda:11.8.0-base-ubuntu22.04 AS python-deploy
|
||||
|
||||
ENV PYTHON_VERSION=3.10
|
||||
|
||||
ARG WHISPER_MODEL
|
||||
|
||||
WORKDIR /etc/whisperbox
|
||||
|
||||
RUN export DEBIAN_FRONTEND=noninteractive \
|
||||
&& apt-get -qq update \
|
||||
&& apt-get -qq install --no-install-recommends \
|
||||
python${PYTHON_VERSION} \
|
||||
python${PYTHON_VERSION}-venv \
|
||||
python3-pip \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 && \
|
||||
ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
|
||||
ln -s -f /usr/bin/pip3 /usr/bin/pip
|
||||
|
||||
COPY pyproject.toml .
|
||||
|
||||
RUN python -m venv /opt/venv && \
|
||||
/opt/venv/bin/pip install -U pip wheel && \
|
||||
/opt/venv/bin/pip install -U .[worker]
|
||||
|
||||
COPY --from=mwader/static-ffmpeg:latest /ffmpeg /usr/local/bin/
|
||||
COPY --from=mwader/static-ffmpeg:latest /ffprobe /usr/local/bin/
|
||||
|
||||
COPY app ./app
|
||||
|
||||
ENV VIRTUAL_ENV /opt/venv
|
||||
ENV PATH /opt/venv/bin:$PATH
|
||||
|
||||
COPY scripts/download_models.py .
|
||||
RUN python download_models.py ${WHISPER_MODEL}
|
||||
|
||||
CMD celery --app=app.worker.main.celery worker --loglevel=info --concurrency=1 --pool=solo
|
||||
Reference in New Issue
Block a user