mirror of
https://github.com/linuxserver/docker-piper.git
synced 2026-03-16 00:01:56 +08:00
No idea if it'll actually work
This commit is contained in:
parent
b9b803ef75
commit
ec7746f332
18
Dockerfile
18
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 && \
|
||||
|
||||
@ -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()
|
||||
@ -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
|
||||
)
|
||||
@ -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
|
||||
|
||||
@ -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}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user