Skip to content

Commit

Permalink
Update docker image to use CUDA 11.8 (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
slackr31337 authored Jan 14, 2025
1 parent b58a2e7 commit 53c17c8
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 22 deletions.
55 changes: 37 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,51 @@
FROM nvidia/cuda:11.7.1-base-ubuntu22.04
##########################################
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04

# Install Whisper
WORKDIR /usr/src
ARG WHISPER_VERSION='1.0.1'
ARG WHISPER_VERSION='2.4.0'

ENV LANG=C.UTF-8
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /app

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
apt-get update && apt-get upgrade -y &&\
apt-get install -y --no-install-recommends \
wget \
curl \
vim \
git \
python3 \
python3-dev \
python3-venv \
python3-pip \
build-essential \
cmake \
ca-certificates \
pkg-config

RUN \
python3 -m venv /app &&\
\
&& pip3 install --no-cache-dir -U \
. /app/bin/activate && \
/app/bin/python3 -m pip install --no-cache-dir -U \
setuptools \
wheel \
&& pip3 install --no-cache-dir torch \
&& pip3 install --no-cache-dir \
"wyoming-faster-whisper==${WHISPER_VERSION}" \
wheel &&\
\
/app/bin/python3 -m pip install --no-cache-dir torch &&\
\
/app/bin/python3 -m pip install --no-cache-dir \
--extra-index-url https://www.piwheels.org/simple \
"wyoming-faster-whisper @ https://github.com/rhasspy/wyoming-faster-whisper/archive/refs/tags/v${WHISPER_VERSION}.tar.gz" &&\
\
&& apt-get purge -y --auto-remove \
apt-get purge -y --auto-remove \
build-essential \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
python3-dev &&\
\
rm -rf /var/lib/apt/lists/*

WORKDIR /
COPY run.sh ./
COPY run.sh .

EXPOSE 10300

ENTRYPOINT ["bash", "/run.sh"]
ENTRYPOINT ["bash", "/app/run.sh"]
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
Wyoming Whisper docker container with GPU support for Home-Assistant

[![Publish Docker image](https://github.com/slackr31337/wyoming-whisper-gpu/actions/workflows/docker-image.yml/badge.svg)](https://github.com/slackr31337/wyoming-whisper-gpu/actions/workflows/docker-image.yml)
https://github.com/rhasspy/wyoming-faster-whisper


[![Publish Docker image](https://github.com/slackr31337/wyoming-whisper-gpu/actions/workflows/docker-image.yml/badge.svg)](https://github.com/slackr31337/wyoming-whisper-gpu/actions/workflows/docker-image.yml)


docker pull ghcr.io/slackr31337/wyoming-whisper-gpu:latest


# Use environment variable to set model (default: tiny-int8)

> MODEL="Systran/faster-distil-whisper-small.en"
>
> LANGUAGE="en"
>
11 changes: 8 additions & 3 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#!/usr/bin/env bash

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/python3.10/dist-packages/nvidia/cudnn/lib/
python3 -m wyoming_faster_whisper \
export LD_LIBRARY_PATH=/app/lib:/app/lib/python3.10/dist-packages/nvidia/cudnn/lib/:$LD_LIBRARY_PATH

source /app/bin/activate
/app/bin/python3 -m wyoming_faster_whisper \
--uri 'tcp://0.0.0.0:10300' \
--data-dir /data \
--download-dir /data "$@"
--download-dir /data \
--model "${MODEL:-tiny-int8}" \
--language "${LANGUAGE:-en}" \
"$@"

0 comments on commit 53c17c8

Please sign in to comment.