Skip to content

Commit f2a939e

Browse files
committed
Fixes from the last rebase, and add speech-to-phrase
1 parent 9a46639 commit f2a939e

File tree

10 files changed

+61
-70
lines changed

10 files changed

+61
-70
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,4 +121,3 @@ docker compose down
121121

122122
You can extend those files adding your own languages.
123123
More on docker compose extend in the [official documentation](https://docs.docker.com/compose/multiple-compose-files/extends/).
124-

docker-compose.base.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ services:
5050
# - "10400:10400"
5151
# <<: [ *common ]
5252

53+
# speech-to-phrase:
54+
# build:
55+
# context: ./speech-to-phrase/
56+
# ports:
57+
# - "10300:10300"
58+
# <<: [ *common ]
59+
5360
# wyoming-vosk:
5461
# build:
5562
# context: ./vosk/

docker-compose.gpu.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ services:
4545
extends:
4646
file: docker-compose.base.yml
4747
service: wyoming-openwakeword
48-
build:
49-
dockerfile: GPU.Dockerfile
5048
<<: [ *gpu ]
5149

5250
# wyoming-porcupine:
@@ -61,6 +59,12 @@ services:
6159
# service: wyoming-snowboy
6260
# <<: [ *gpu ]
6361

62+
# speech-to-phrase:
63+
# extends:
64+
# file: docker-compose.base.yml
65+
# service: speech-to-phrase
66+
# <<: [ *gpu ]
67+
6468
# wyoming-vosk:
6569
# extends:
6670
# file: docker-compose.base.yml

openwakeword/GPU.Dockerfile

Lines changed: 0 additions & 35 deletions
This file was deleted.

piper/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
ARG BASE=debian:bookworm-slim
22
FROM $BASE
3+
34
ARG TARGETARCH
45
ARG TARGETVARIANT
56

piper/GPU.Dockerfile

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,51 @@
11
ARG BASE=debian:bookworm-slim
22
FROM $BASE
33

4-
ARG EXTRA_DEPENDENCIES
54
ARG RUN_SCRIPT='run.sh'
5+
66
ARG TARGETARCH
77
ARG TARGETVARIANT
88

99
# Install Piper
1010
WORKDIR /usr/src
11-
ARG WYOMING_PIPER_VERSION='1.5.0'
11+
ARG WYOMING_PIPER_VERSION='1.6.3'
12+
ARG WYOMING_VERSION='1.7.2'
1213
ARG BINARY_PIPER_VERSION='1.2.0'
13-
14-
# Create and activate virtual environment
15-
ENV VIRTUAL_ENV=/opt/venv
16-
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
14+
ENV PIP_BREAK_SYSTEM_PACKAGES=1
1715

1816
RUN \
1917
apt-get update \
2018
&& apt-get install -y --no-install-recommends \
21-
wget \
2219
curl \
2320
python3 \
2421
python3-pip \
25-
python3-venv \
22+
python3-dev \
23+
build-essential \
2624
\
27-
&& rm -rf /var/lib/apt/lists/* \
28-
\
29-
# Create virtual environment
30-
&& python3 -m venv $VIRTUAL_ENV
31-
32-
RUN \
33-
pip3 install --no-cache-dir -U \
25+
&& pip3 install --no-cache-dir -U \
3426
setuptools \
3527
wheel \
36-
$EXTRA_DEPENDENCIES \
37-
\
38-
&& 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 \
39-
\
40-
&& mv piper_phonemize-1.1.0-cp311-cp311-manylinux_2_28_x86_64.whl piper_phonemize-1.1.0-py3-none-any.whl \
41-
\
42-
&& pip3 install --no-cache-dir --force-reinstall --no-deps \
43-
"piper-tts==${BINARY_PIPER_VERSION}" \
44-
\
45-
&& pip3 install --no-cache-dir --force-reinstall --no-deps \
46-
piper_phonemize-1.1.0-py3-none-any.whl \
47-
\
4828
&& pip3 install --no-cache-dir \
4929
"wyoming-piper @ https://github.com/rhasspy/wyoming-piper/archive/refs/tags/v${WYOMING_PIPER_VERSION}.tar.gz" \
5030
\
51-
&& rm -r piper_phonemize-1.1.0-py3-none-any.whl
31+
&& pip3 install --no-cache-dir \
32+
"wyoming[http] @ https://github.com/OHF-voice/wyoming/archive/refs/tags/${WYOMING_VERSION}.tar.gz" \
33+
\
34+
&& curl -L -s \
35+
"https://github.com/rhasspy/piper/releases/download/v${BINARY_PIPER_VERSION}/piper_${TARGETARCH}${TARGETVARIANT}.tar.gz" \
36+
| tar -zxvf - -C /usr/share \
37+
\
38+
&& apt-get remove -y --purge \
39+
python3-dev \
40+
build-essential \
41+
&& apt-get clean -y \
42+
&& rm -rf /var/lib/apt/lists/*
5243

5344
WORKDIR /
5445
COPY $RUN_SCRIPT ./
5546
ENV RUN_SCRIPT_ENV="/${RUN_SCRIPT}"
5647

5748
EXPOSE 10200
49+
EXPOSE 5000
5850

5951
ENTRYPOINT ["bash", "-c", "exec $RUN_SCRIPT_ENV \"${@}\"", "--"]

piper/run-gpu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ python3 -m wyoming.http.tts_server \
88
HTTP_SERVER_PID=$!
99

1010
python3 -m wyoming_piper \
11-
--piper 'piper' \
11+
--piper '/usr/share/piper/piper' \
1212
--use-cuda \
1313
--uri 'tcp://0.0.0.0:10200' \
1414
--data-dir /data \

piper/run.sh

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
11
#!/usr/bin/env bash
2+
set -e
3+
4+
python3 -m wyoming.http.tts_server \
5+
--uri 'tcp://127.0.0.1:10200' \
6+
--host '0.0.0.0' \
7+
--port 5000 &
8+
HTTP_SERVER_PID=$!
9+
210
python3 -m wyoming_piper \
311
--piper '/usr/share/piper/piper' \
412
--uri 'tcp://0.0.0.0:10200' \
513
--data-dir /data \
6-
--download-dir /data "$@"
14+
--download-dir /data \
15+
--streaming "$@" &
16+
MAIN_APP_PID=$!
17+
18+
# Forward termination signals to child processes
19+
terminate() {
20+
echo "Terminating..."
21+
kill -TERM "${HTTP_SERVER_PID}" "${MAIN_APP_PID}"
22+
wait
23+
}
24+
25+
trap terminate SIGTERM SIGINT
26+
27+
wait "${MAIN_APP_PID}"
28+
terminate

snowboy/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ COPY run.sh ./
4242
EXPOSE 10400
4343

4444
ENTRYPOINT ["bash", "/run.sh"]
45-

speech-to-phrase/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
FROM debian:bookworm-slim
1+
ARG BASE=debian:bookworm-slim
2+
FROM $BASE
3+
24
ARG TARGETARCH
35
ARG TARGETVARIANT
46

0 commit comments

Comments
 (0)