INNER CODE UNIT · Python
_check_cancelled
devnen/Kitten-TTS-Server · engine.py:185
def _check_cancelled():
"""Raises RuntimeError if model loading has been cancelled."""
if _cancel_event.is_set():
raise RuntimeError("Model loading cancelled by user.")
def _update_download_status(phase: str, detail: str = "", progress_pct: int = 0, error: str = None):
"""Update the download status for the UI to poll."""
global _download_status
_download_status = {
"active": error is None and phase != "complete",
"phase": phase,
"detail": detail,
"progress_pct": progress_pct,
"error": error,
}