mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-15 20:14:42 +02:00
feat(voice): détection deux niveaux + service systemd
- VAD mode : Whisper small (~0.3s) pour détecter "ok hermes", large-v3 uniquement pour transcrire la commande - PTT mode : large-v3 direct (inchangé) - install-service.sh : installe hermes-voice comme service utilisateur systemd (auto-start à la session) - doc mise à jour Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a3ba3089e2
commit
69ea82c0e7
2 changed files with 120 additions and 37 deletions
53
tools/hermes-voice/install-service.sh
Executable file
53
tools/hermes-voice/install-service.sh
Executable file
|
|
@ -0,0 +1,53 @@
|
|||
#!/usr/bin/env bash
|
||||
# Installe hermes-voice comme service utilisateur systemd
|
||||
# Lance automatiquement au démarrage de session, écoute "Ok Hermes, ..."
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
VENV_PYTHON="$SCRIPT_DIR/.venv/bin/python"
|
||||
SERVICE_DIR="$HOME/.config/systemd/user"
|
||||
SERVICE_FILE="$SERVICE_DIR/hermes-voice.service"
|
||||
|
||||
# Vérifications
|
||||
if [ ! -f "$VENV_PYTHON" ]; then
|
||||
echo "❌ venv introuvable — lancez d'abord :"
|
||||
echo " python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir -p "$SERVICE_DIR"
|
||||
|
||||
cat > "$SERVICE_FILE" << EOF
|
||||
[Unit]
|
||||
Description=Hermes Voice Client
|
||||
After=network-online.target
|
||||
Wants=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=$VENV_PYTHON $SCRIPT_DIR/hermes-voice.py
|
||||
WorkingDirectory=$SCRIPT_DIR
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
Environment=PYTHONUNBUFFERED=1
|
||||
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
SyslogIdentifier=hermes-voice
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
||||
EOF
|
||||
|
||||
systemctl --user daemon-reload
|
||||
systemctl --user enable hermes-voice
|
||||
systemctl --user start hermes-voice
|
||||
|
||||
echo ""
|
||||
echo "✓ Service installé et démarré"
|
||||
echo ""
|
||||
echo "Commandes utiles :"
|
||||
echo " systemctl --user status hermes-voice"
|
||||
echo " journalctl --user -u hermes-voice -f"
|
||||
echo " systemctl --user stop hermes-voice"
|
||||
echo " systemctl --user restart hermes-voice"
|
||||
Loading…
Add table
Add a link
Reference in a new issue