diff --git a/Dockerfile b/Dockerfile index e20e7ba..ebf9af6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,17 +12,28 @@ LABEL maintainer="thespad" ENV DEBIAN_FRONTEND="noninteractive" \ TMPDIR="/run/piper-temp" -RUN --mount=type=bind,source=/patch,target=/patch \ +RUN \ apt-get update && \ apt-get install -y --no-install-recommends \ python3-venv && \ if [ -z ${PIPER_VERSION+x} ]; then \ - PIPER_VERSION=$(curl -sL https://pypi.python.org/pypi/wyoming-piper/json |jq -r '. | .info.version'); \ + PIPER_VERSION=$(curl -sL "https://api.github.com/repos/rhasspy/wyoming-piper/commits/master" \ + | jq -r .sha); \ fi && \ + mkdir -p /tmp/piper-build && \ + curl -sL -o \ + /tmp/piper.tar.gz -L \ + "https://github.com/rhasspy/wyoming-piper/archive/${PIPER_VERSION}.tar.gz" && \ + tar xzf \ + /tmp/piper.tar.gz -C \ + /tmp/piper-build --strip-components=1 && \ + cd /tmp/piper-build && \ python3 -m venv /lsiopy && \ pip install -U --no-cache-dir \ pip \ wheel && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ . && \ + pip uninstall -y onnxruntime && \ pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ \ nvidia-cublas-cu12 \ nvidia-cuda-nvrtc-cu12 \ @@ -31,8 +42,7 @@ RUN --mount=type=bind,source=/patch,target=/patch \ nvidia-cufft-cu12 \ nvidia-curand-cu12 \ onnxruntime-gpu \ - piper-tts \ - "wyoming-piper==${PIPER_VERSION}" && \ + piper-tts && \ printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ echo "**** cleanup ****" && \ apt-get autoremove -y && \ diff --git a/patch/__main__.patch b/patch/__main__.patch deleted file mode 100644 index 53cb972..0000000 --- a/patch/__main__.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- __main__-old.py 2024-11-26 16:26:59.644200503 +0000 -+++ __main__.py 2024-11-26 16:19:53.459497442 +0000 -@@ -65,6 +65,11 @@ - action="store_true", - help="Download latest voices.json during startup", - ) -+ parser.add_argument( -+ "--cuda", -+ action="store_true", -+ help="Use GPU" -+ ) - # - parser.add_argument("--debug", action="store_true", help="Log DEBUG messages") - args = parser.parse_args() diff --git a/patch/process.patch b/patch/process.patch deleted file mode 100644 index 269d965..0000000 --- a/patch/process.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- process-old.py 2024-11-26 16:20:27.856796223 +0000 -+++ process.py 2024-11-26 16:19:40.522385074 +0000 -@@ -148,6 +148,9 @@ - if self.args.noise_w: - piper_args.extend(["--noise-w", str(self.args.noise_w)]) - -+ if self.args.cuda: -+ piper_args.extend(["--cuda"]) -+ - _LOGGER.debug( - "Starting piper process: %s args=%s", self.args.piper, piper_args - ) diff --git a/readme-vars.yml b/readme-vars.yml index ed2766b..b937c1b 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -33,7 +33,6 @@ opt_param_env_vars: - {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."} - {env_var: "PIPER_NOISEW", env_value: "0.333", desc: "Controls the variability of speaking cadence. Values above 1 produce extreme stutters and pauses."} - {env_var: "PIPER_SPEAKER", env_value: "0", desc: "Speaker number to use if the voice supports multiple speakers."} - - {env_var: "PIPER_PROCS", env_value: "1", desc: "Number of Piper processes to run simultaneously."} - {env_var: "STREAMING", env_value: "", desc: "Setting to `true`, or any other value, will enable support for streaming audio on sentence boundaries."} readonly_supported: true # application setup block diff --git a/root/etc/s6-overlay/s6-rc.d/svc-piper/run b/root/etc/s6-overlay/s6-rc.d/svc-piper/run index b8447ec..a5b8c00 100755 --- a/root/etc/s6-overlay/s6-rc.d/svc-piper/run +++ b/root/etc/s6-overlay/s6-rc.d/svc-piper/run @@ -15,23 +15,19 @@ if [[ -z ${LOCAL_ONLY} ]]; then UPDATE_MODELS=true fi - LD_LIBRARY_PATH="/lsiopy/lib/python3.12/site-packages/onnxruntime/capi:$LD_LIBRARY_PATH" exec \ s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 10200" \ s6-setuidgid abc python3 -m wyoming_piper \ - --piper '/lsiopy/bin/piper' \ --uri 'tcp://0.0.0.0:10200' \ --length-scale "${PIPER_LENGTH:-1.0}" \ --noise-scale "${PIPER_NOISE:-0.667}" \ --noise-w "${PIPER_NOISEW:-0.333}" \ --speaker "${PIPER_SPEAKER:-0}" \ --voice "${PIPER_VOICE}" \ - --max-piper-procs "${PIPER_PROCS:-1}" \ --data-dir /config \ --download-dir /config \ - --cuda \ + --use-cuda \ ${UPDATE_MODELS:+--update-voices} \ ${STREAMING:+--streaming} -