Fix Piper TTS absolute path resolution and improve deployment workflow

This commit resolves the "download entire voices" issue by properly handling
absolute paths in Piper model configuration and improves the deployment system.

Key changes:
- speech.py: Detect absolute paths and omit --data-dir/--download-dir flags
  when using absolute model paths, allowing Piper to load models directly
- speech.py: Add debug logging and stderr capture for Piper subprocess
- voice_to_speaker.default.yaml: Use absolute paths for all Piper models
- Makefile: Load deployment config from vars.sh for better security
- Makefile: Change restart to rebuild container ensuring code updates apply
- Add vars.sh.example template for deployment configuration
- .gitignore: Add vars.sh to prevent committing deployment secrets

Tested successfully with en_US-libritts_r-medium model using absolute path:
/app/voices/en/en_US/libritts_r/medium/en_US-libritts_r-medium.onnx

🦝 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Russell Ballestrini 2025-11-09 09:05:13 -05:00
parent a0e94be7af
commit eb899deca2
4 changed files with 43 additions and 9 deletions

View file

@ -1,10 +1,18 @@
# Raccoon Mission: OpenedAI Speech Development Makefile
# Deploy to ai.foxhop.net server with ease
# Deploy to remote server with ease
# Configuration is loaded from vars.sh (copy vars.sh.example to vars.sh)
REMOTE_HOST = ai.foxhop.net
REMOTE_USER = fox
REMOTE_PATH = ~/openedai-speech-fresh
CONTAINER_NAME = openedai-speech-fresh-server-1
# Load configuration from vars.sh if it exists
ifneq (,$(wildcard vars.sh))
include vars.sh
export
endif
# Fallback defaults if vars.sh is not found
REMOTE_HOST ?= localhost
REMOTE_USER ?= $(USER)
REMOTE_PATH ?= ~/openedai-speech-fresh
CONTAINER_NAME ?= openedai-speech-fresh-server-1
.PHONY: help deploy sync restart logs test clean stop start voices
@ -36,8 +44,8 @@ deploy: sync restart
@echo "✅ Deployment complete!"
restart:
@echo "🔄 Restarting container on $(REMOTE_HOST)..."
ssh $(REMOTE_USER)@$(REMOTE_HOST) "cd $(REMOTE_PATH) && docker compose restart"
@echo "🔄 Rebuilding and restarting container on $(REMOTE_HOST)..."
ssh $(REMOTE_USER)@$(REMOTE_HOST) "cd $(REMOTE_PATH) && docker compose up -d --build"
stop:
@echo "🛑 Stopping container on $(REMOTE_HOST)..."