"www" in der Blockliste wurde beim Zusammenziehen gezogener Buchstaben zu
"w" und traf als kurzer Eintrag jedes Wort, das mit w anfaengt. Im Stream
flog damit fast jede Nachricht raus ("wie", "weg"), die Punkte gingen
zurueck. Was nach dem Normalisieren unter 3 Buchstaben hat, trifft jetzt
nur noch als ganzes Wort.
de_DE-mls-medium, Sprecher 0, klang verwaschen. Die Phoneme stimmten, es
lag am Modell. Vorgabe ist jetzt de_DE-thorsten-medium; im Hub schon so
eingestellt.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
62 lines
2.4 KiB
Bash
62 lines
2.4 KiB
Bash
#!/usr/bin/env bash
|
|
# Piper und die deutsche Stimme in den Hub-LXC bringen.
|
|
#
|
|
# Einmalig noetig, danach nur wieder fuer eine andere Stimme. Das Deploy-
|
|
# Skript fasst beides nicht an: Piper liegt unter /opt/piper, die Stimme im
|
|
# Modellordner, und beides ueberlebt jedes Ausrollen.
|
|
#
|
|
# Piper kommt als fertiges Paket mit eigenem espeak-ng und onnxruntime - im
|
|
# Container muss nichts aus apt dazu. Die Version ist festgenagelt und am
|
|
# 2026-09-23 im LXC geprueft: 200 Zeichen in 0,7 s.
|
|
#
|
|
# Aufruf: scripts/install-piper.sh
|
|
# Umgebung (mit Vorgaben):
|
|
# PVE_HOST=192.168.2.20 Proxmox-Host
|
|
# CT=141 Container-ID
|
|
# STIMME=de_DE-thorsten-medium Name aus huggingface.co/rhasspy/piper-voices
|
|
set -euo pipefail
|
|
|
|
PVE_HOST="${PVE_HOST:-192.168.2.20}"
|
|
CT="${CT:-141}"
|
|
STIMME="${STIMME:-de_DE-thorsten-medium}"
|
|
|
|
# de_DE-thorsten-medium -> de/de_DE/thorsten/medium
|
|
IFS=- read -r LOCALE SPRECHER QUALI <<< "$STIMME"
|
|
SPRACHE="${LOCALE%%_*}"
|
|
VOICES="https://huggingface.co/rhasspy/piper-voices/resolve/main/${SPRACHE}/${LOCALE}/${SPRECHER}/${QUALI}"
|
|
PIPER="https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_x86_64.tar.gz"
|
|
|
|
ssh "root@${PVE_HOST}" "pct exec ${CT} -- bash -lc '
|
|
set -e
|
|
if [ ! -x /opt/piper/piper ]; then
|
|
echo \"Lade Piper ...\"
|
|
curl -fsSL -o /tmp/piper.tgz ${PIPER}
|
|
tar xzf /tmp/piper.tgz -C /opt --no-same-owner
|
|
rm -f /tmp/piper.tgz
|
|
fi
|
|
|
|
mkdir -p /var/lib/abdulive/models/piper
|
|
cd /var/lib/abdulive/models/piper
|
|
if [ ! -f ${STIMME}.onnx ]; then
|
|
echo \"Lade Stimme ${STIMME} ...\"
|
|
curl -fsSL -o ${STIMME}.onnx.json ${VOICES}/${STIMME}.onnx.json
|
|
curl -fsSL -o ${STIMME}.onnx.part ${VOICES}/${STIMME}.onnx
|
|
mv ${STIMME}.onnx.part ${STIMME}.onnx
|
|
fi
|
|
|
|
# Der Dienst findet Piper ueber PIPER_BIN. Ein Drop-in statt einer
|
|
# Aenderung an der Unit, damit ein neues Ausrollen der Unit das nicht
|
|
# ueberschreibt.
|
|
mkdir -p /etc/systemd/system/abdulive-hub.service.d
|
|
printf \"[Service]\nEnvironment=PIPER_BIN=/opt/piper/piper\n\" \
|
|
> /etc/systemd/system/abdulive-hub.service.d/piper.conf
|
|
systemctl daemon-reload
|
|
|
|
echo \"Probe ...\"
|
|
echo \"Hallo, hier spricht der Hub.\" \
|
|
| /opt/piper/piper --model ${STIMME}.onnx --output_file - --quiet 2>/dev/null \
|
|
| head -c 4 | grep -q RIFF && echo \"Piper spricht.\"
|
|
'"
|
|
|
|
echo "Fertig. Wirksam nach dem naechsten Neustart des Hubs (scripts/deploy-hub.sh)."
|