Skip to content

Commit 4e9bcd2

Browse files
authored
Merge pull request #14 from linuxserver/local-mode
2 parents 66962e5 + be8f28d commit 4e9bcd2

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

Dockerfile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,8 @@ RUN \
2424
pip \
2525
wheel && \
2626
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ \
27+
piper-tts \
2728
"wyoming-piper==${PIPER_VERSION}" && \
28-
if [ -z ${PIPER_BIN_VERSION+x} ]; then \
29-
PIPER_BIN_VERSION=$(curl -sL "https://api.github.com/repos/rhasspy/piper/releases/latest" \
30-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
31-
fi && \
32-
curl -sL -o \
33-
/tmp/piper.tar.gz -L \
34-
"https://github.com/rhasspy/piper/releases/download/${PIPER_BIN_VERSION}/piper_linux_x86_64.tar.gz" && \
35-
tar xzf \
36-
/tmp/piper.tar.gz -C \
37-
/usr/share && \
3829
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
3930
echo "**** cleanup ****" && \
4031
rm -rf \

Dockerfile.aarch64

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,8 @@ RUN \
2424
pip \
2525
wheel && \
2626
pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ \
27+
piper-tts \
2728
"wyoming-piper==${PIPER_VERSION}" && \
28-
if [ -z ${PIPER_BIN_VERSION+x} ]; then \
29-
PIPER_BIN_VERSION=$(curl -sL "https://api.github.com/repos/rhasspy/piper/releases/latest" \
30-
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
31-
fi && \
32-
curl -sL -o \
33-
/tmp/piper.tar.gz -L \
34-
"https://github.com/rhasspy/piper/releases/download/${PIPER_BIN_VERSION}/piper_linux_aarch64.tar.gz" && \
35-
tar xzf \
36-
/tmp/piper.tar.gz -C \
37-
/usr/share && \
3829
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
3930
echo "**** cleanup ****" && \
4031
rm -rf \

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ services:
8484
- PGID=1000
8585
- TZ=Etc/UTC
8686
- PIPER_VOICE=en_US-lessac-medium
87+
- LOCAL_ONLY= #optional
8788
- PIPER_LENGTH=1.0 #optional
8889
- PIPER_NOISE=0.667 #optional
8990
- PIPER_NOISEW=0.333 #optional
@@ -106,6 +107,7 @@ docker run -d \
106107
-e PGID=1000 \
107108
-e TZ=Etc/UTC \
108109
-e PIPER_VOICE=en_US-lessac-medium \
110+
-e LOCAL_ONLY= `#optional` \
109111
-e PIPER_LENGTH=1.0 `#optional` \
110112
-e PIPER_NOISE=0.667 `#optional` \
111113
-e PIPER_NOISEW=0.333 `#optional` \
@@ -129,6 +131,7 @@ Containers are configured using parameters passed at runtime (such as those abov
129131
| `-e PGID=1000` | for GroupID - see below for explanation |
130132
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
131133
| `-e PIPER_VOICE=en_US-lessac-medium` | The [Piper voice](https://huggingface.co/rhasspy/piper-voices/tree/main) to use, in the format `<language>-<name>-<quality>` |
134+
| `-e LOCAL_ONLY=` | If set to `true`, or any other value, the container will not attempt to download models from HuggingFace and will only use locally-provided models. |
132135
| `-e PIPER_LENGTH=1.0` | Voice speaking rate, 1.0 is default with < 1.0 being faster and > 1.0 being slower. |
133136
| `-e PIPER_NOISE=0.667` | Controls the variability of the voice by adding noise. Values above 1 will start to degrade audio. |
134137
| `-e PIPER_NOISEW=0.333` | Controls the variability of speaking cadence. Values above 1 produce extreme stutters and pauses. |
@@ -300,6 +303,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
300303

301304
## Versions
302305

306+
* **29.08.25:** - Add support for local only mode.
303307
* **10.08.25:** - Add streaming support.
304308
* **18.07.24:** - Rebase to Ubuntu Noble.
305309
* **25.11.23:** - Initial Release.

readme-vars.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ param_ports:
3030
# optional container parameters
3131
opt_param_usage_include_env: true
3232
opt_param_env_vars:
33+
- {env_var: "LOCAL_ONLY", env_value: "", desc: "If set to `true`, or any other value, the container will not attempt to download models from HuggingFace and will only use locally-provided models."}
3334
- {env_var: "PIPER_LENGTH", env_value: "1.0", desc: "Voice speaking rate, 1.0 is default with < 1.0 being faster and > 1.0 being slower."}
3435
- {env_var: "PIPER_NOISE", env_value: "0.667", desc: "Controls the variability of the voice by adding noise. Values above 1 will start to degrade audio."}
3536
- {env_var: "PIPER_NOISEW", env_value: "0.333", desc: "Controls the variability of speaking cadence. Values above 1 produce extreme stutters and pauses."}
@@ -86,6 +87,7 @@ init_diagram: |
8687
"piper:latest" <- Base Images
8788
# changelog
8889
changelogs:
90+
- {date: "29.08.25:", desc: "Add support for local only mode."}
8991
- {date: "10.08.25:", desc: "Add streaming support."}
9092
- {date: "18.07.24:", desc: "Rebase to Ubuntu Noble."}
9193
- {date: "25.11.23:", desc: "Initial Release."}
Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
#!/command/with-contenv bash
22
# shellcheck shell=bash
33

4+
unset UPDATE_MODELS
5+
6+
if [[ -z ${LOCAL_ONLY} ]]; then
7+
UPDATE_MODELS=true
8+
fi
9+
410
exec \
511
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 10200" \
612
s6-setuidgid abc python3 -m wyoming_piper \
7-
--piper '/usr/share/piper/piper' \
13+
--piper '/lsiopy/bin/piper' \
814
--uri 'tcp://0.0.0.0:10200' \
915
--length-scale "${PIPER_LENGTH:-1.0}" \
1016
--noise-scale "${PIPER_NOISE:-0.667}" \
@@ -13,5 +19,6 @@ exec \
1319
--voice "${PIPER_VOICE}" \
1420
--max-piper-procs "${PIPER_PROCS:-1}" \
1521
--data-dir /config \
16-
--download-dir /config --update-voices \
22+
--download-dir /config \
23+
${UPDATE_MODELS:+--update-voices} \
1724
${STREAMING:+--streaming}

0 commit comments

Comments
 (0)