Skip to content

Commit

Permalink
chore: Update images and whisper version
Browse files Browse the repository at this point in the history
  • Loading branch information
edurenye committed Jan 8, 2025
1 parent 936b766 commit 4da560b
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
7 changes: 3 additions & 4 deletions docker-compose.gpu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3'
x-gpu: &gpu
build:
args:
- BASE=nvidia/cuda:12.1.1-cudnn8-runtime-ubuntu22.04
- BASE=nvidia/cuda:12.3.2-cudnn9-runtime-ubuntu22.04
runtime: nvidia
deploy:
resources:
Expand All @@ -23,12 +23,11 @@ services:
build:
dockerfile: GPU.Dockerfile
args:
- BASE=nvidia/cuda:11.2.2-cudnn8-runtime-ubuntu20.04
- EXTRA_DEPENDENCIES=onnxruntime-gpu
- RUN_SCRIPT=run-gpu.sh
volumes:
- ./piper/__main__.py:/usr/local/lib/python3.8/dist-packages/wyoming_piper/__main__.py
- ./piper/process.py:/usr/local/lib/python3.8/dist-packages/wyoming_piper/process.py
- ./piper/__main__.py:/opt/venv/lib/python3.11/site-packages/wyoming_piper/__main__.py
- ./piper/process.py:/opt/venv/lib/python3.11/site-packages/wyoming_piper/process.py

wyoming-whisper:
extends:
Expand Down
16 changes: 12 additions & 4 deletions piper/GPU.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BASE=debian:bookworm-slim
FROM $BASE

ARG EXTRA_DEPENDENCIES
ARG RUN_SCRIPT='run-nongpu.sh'
ARG RUN_SCRIPT='run.sh'
ARG TARGETARCH
ARG TARGETVARIANT

Expand All @@ -11,25 +11,33 @@ WORKDIR /usr/src
ARG WYOMING_PIPER_VERSION='1.5.0'
ARG BINARY_PIPER_VERSION='1.2.0'

# Create and activate virtual environment
ENV VIRTUAL_ENV=/opt/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"

RUN \
apt-get update \
&& apt-get install -y --no-install-recommends \
wget \
curl \
python3 \
python3-pip \
python3-venv \
\
&& rm -rf /var/lib/apt/lists/* \
\
&& rm -rf /var/lib/apt/lists/*
# Create virtual environment
&& python3 -m venv $VIRTUAL_ENV

RUN \
pip3 install --no-cache-dir -U \
setuptools \
wheel \
$EXTRA_DEPENDENCIES \
\
&& wget https://github.com/rhasspy/piper-phonemize/releases/download/v1.1.0/piper_phonemize-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl \
&& wget https://github.com/rhasspy/piper-phonemize/releases/download/v1.1.0/piper_phonemize-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl \
\
&& mv piper_phonemize-1.1.0-cp39-cp39-manylinux_2_28_x86_64.whl piper_phonemize-1.1.0-py3-none-any.whl \
&& mv piper_phonemize-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl piper_phonemize-1.1.0-py3-none-any.whl \
\
&& pip3 install --no-cache-dir --force-reinstall --no-deps \
"piper-tts==${BINARY_PIPER_VERSION}" \
Expand Down
2 changes: 1 addition & 1 deletion piper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def main() -> None:
help="Download latest voices.json during startup",
)
parser.add_argument(
"--cuda",
"--use-cuda",
action="store_true",
help="Use GPU"
)
Expand Down
4 changes: 2 additions & 2 deletions piper/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ async def get_process(self, voice_name: Optional[str] = None) -> PiperProcess:
if self.args.noise_w:
piper_args.extend(["--noise-w", str(self.args.noise_w)])

if self.args.cuda:
piper_args.extend(["--cuda"])
if self.args.use_cuda:
piper_args.extend(["--use-cuda"])

_LOGGER.debug(
"Starting piper process: %s args=%s", self.args.piper, piper_args
Expand Down
2 changes: 1 addition & 1 deletion piper/run-gpu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
python3 -m wyoming_piper \
--piper 'piper' \
--cuda \
--use-cuda \
--uri 'tcp://0.0.0.0:10200' \
--data-dir /data \
--download-dir /data "$@"
2 changes: 1 addition & 1 deletion whisper/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM $BASE

# Install Whisper
WORKDIR /usr/src
ARG WYOMING_WHISPER_VERSION='2.2.0'
ARG WYOMING_WHISPER_VERSION='2.4.0'

RUN \
apt-get update \
Expand Down

0 comments on commit 4da560b

Please sign in to comment.