Memory-Guards + Voice-Sidecar-Install robuster
- mem0_service: Junk-Fact-Guard post-extraction (Regex + sofortiges Delete), custom_instructions praezisiert - mc2-memory-Plugin: Recall-Schwelle 0.3->0.5, Trivial-Turn-Filter (Begruessung/Quittungen nicht lernen) - voice_service/install.sh: Python-3.12-venv via uv, Piper-Binary + DE-Stimmen, Chatterbox best-effort Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,30 +7,48 @@ set -euo pipefail
|
||||
SRC="${MC2_SRC:-$HOME/mission-control-v2}"
|
||||
VENV="$HOME/.voice/venv"
|
||||
VOICES="$HOME/.voice/voices"
|
||||
PY="${VOICE_PYTHON:-python3.12}"
|
||||
UV="$(command -v uv || echo "$HOME/.local/bin/uv")"
|
||||
|
||||
command -v "$PY" >/dev/null 2>&1 || PY=python3 # Fallback, falls python3.12 nicht im PATH
|
||||
# torch/chatterbox brauchen Python ≤3.13 — das Default-python3 der Box ist 3.14. Darum das venv
|
||||
# bevorzugt per uv mit gemanagtem Python 3.12 anlegen (wie das mem0-venv). pip läuft via `uv pip`.
|
||||
pipi() {
|
||||
if [ -x "$UV" ]; then "$UV" pip install --python "$VENV/bin/python" "$@"
|
||||
else "$VENV/bin/python" -m pip install "$@"; fi
|
||||
}
|
||||
|
||||
# --- venv -------------------------------------------------------------------
|
||||
# --- venv (Python 3.12) -----------------------------------------------------
|
||||
if [ ! -x "$VENV/bin/python" ]; then
|
||||
echo "[voice] Erstelle venv ($PY) → $VENV"
|
||||
"$PY" -m venv "$VENV"
|
||||
echo "[voice] Erstelle venv (Python 3.12) → $VENV"
|
||||
if [ -x "$UV" ]; then "$UV" venv --python 3.12 "$VENV"
|
||||
elif command -v python3.12 >/dev/null 2>&1; then python3.12 -m venv "$VENV"
|
||||
else echo "[voice] FATAL: weder uv noch python3.12 vorhanden."; exit 1; fi
|
||||
fi
|
||||
"$VENV/bin/python" -m pip install -q --upgrade pip
|
||||
echo "[voice] venv-Python: $("$VENV/bin/python" --version 2>&1)"
|
||||
|
||||
# --- Kern-Deps (STT + Piper + Server) — required ----------------------------
|
||||
echo "[voice] Installiere Kern-Abhängigkeiten …"
|
||||
"$VENV/bin/python" -m pip install -q -r "$SRC/voice_service/requirements.txt"
|
||||
pipi -q -r "$SRC/voice_service/requirements.txt"
|
||||
|
||||
# --- Chatterbox (Premium-TTS) — best-effort, CPU-torch (kein 2-GB-CUDA-Wheel) ----
|
||||
echo "[voice] Installiere Chatterbox (Premium-TTS, CPU-torch) — best-effort …"
|
||||
if "$VENV/bin/python" -m pip install -q --index-url https://download.pytorch.org/whl/cpu torch torchaudio \
|
||||
&& "$VENV/bin/python" -m pip install -q chatterbox-tts; then
|
||||
if pipi -q --index-url https://download.pytorch.org/whl/cpu torch torchaudio \
|
||||
&& pipi -q chatterbox-tts; then
|
||||
echo "[voice] Chatterbox bereit."
|
||||
else
|
||||
echo "[voice] WARN: Chatterbox-Install fehlgeschlagen — Piper bleibt als Default-Stimme aktiv."
|
||||
fi
|
||||
|
||||
# --- Piper-Binary (offiziell, bringt espeak-ng mit) → ~/.voice/piper -----------
|
||||
if [ ! -x "$HOME/.voice/piper/piper" ]; then
|
||||
echo "[voice] Lade Piper-Binary …"
|
||||
curl -fsSL "https://github.com/rhasspy/piper/releases/download/2023.11.14-2/piper_linux_x86_64.tar.gz" \
|
||||
-o /tmp/piper.tgz \
|
||||
&& tar xzf /tmp/piper.tgz -C "$HOME/.voice" \
|
||||
&& rm -f /tmp/piper.tgz \
|
||||
&& echo "[voice] Piper-Binary: $("$HOME/.voice/piper/piper" --version 2>&1 | head -1 || echo installiert)" \
|
||||
|| echo "[voice] WARN: Piper-Binary-Download fehlgeschlagen."
|
||||
fi
|
||||
|
||||
# --- Piper-Stimmen (Deutsch) nach ~/.voice/voices ---------------------------
|
||||
mkdir -p "$VOICES"
|
||||
BASE="https://huggingface.co/rhasspy/piper-voices/resolve/main/de/de_DE"
|
||||
|
||||
Reference in New Issue
Block a user