-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update docker image to use CUDA 11.8 (#4)
- Loading branch information
1 parent
b58a2e7
commit 53c17c8
Showing
3 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
> | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" \ | ||
"$@" |