Skip to content

Commit 13678b9

Browse files
committed
Support local-only mode
1 parent 66962e5 commit 13678b9

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

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."}

root/etc/s6-overlay/s6-rc.d/svc-piper/run

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
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 \
@@ -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)