INNER CODE UNIT · Python
lifespan
devnen/Kitten-TTS-Server · server.py:127
async def lifespan(app: FastAPI):
"""Manages application startup and shutdown events."""
logger.info("TTS Server: Initializing application...")
try:
logger.info(f"Configuration loaded. Log file at: {get_log_file_path()}")
paths_to_ensure = [
get_output_path(),
Path("ui"),
config_manager.get_path(
"paths.model_cache", "./model_cache", ensure_absolute=True
),
]
for p in paths_to_ensure:
p.mkdir(parents=True, exist_ok=True)
if not engine.load_model():
logger.critical(