lemm-test-100 / backend /start_with_env.py
Gamahea
Deploy Music Generation Studio - 2025-12-12 16:01
aad9d66
raw
history blame
712 Bytes
"""
Wrapper script to start the backend with required environment variables.
This is used by the PowerShell launcher to ensure environment variables are set.
"""
import os
import sys
import subprocess
from pathlib import Path
# Get project root (parent of backend directory)
project_root = Path(__file__).parent.parent
# Set required environment variables
os.environ['PHONEMIZER_ESPEAK_LIBRARY'] = str(project_root / 'external' / 'espeak-ng' / 'libespeak-ng.dll')
os.environ['PHONEMIZER_ESPEAK_PATH'] = str(project_root / 'external' / 'espeak-ng')
# Run the backend run.py script
backend_script = project_root / 'backend' / 'run.py'
# Execute run.py in the same interpreter
exec(open(backend_script).read())