From 919544c0931d53bb81904b6212ff14f856549da3 Mon Sep 17 00:00:00 2001 From: historia Date: Mon, 24 Aug 2026 16:18:38 -0400 Subject: feat: option to unload models from audio.cpp per-run --- app/converter/tts.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/converter/tts.py') diff --git a/app/converter/tts.py b/app/converter/tts.py index 41e3aa5..a83896d 100644 --- a/app/converter/tts.py +++ b/app/converter/tts.py @@ -919,7 +919,8 @@ class AudioCppTTSClient(_BaseTTSClient): print(f"[INFO] Sending instruction with every request: {self.instructions}") print("[INFO] Its effect (style, emotion, delivery) depends on the " "model family; models without instruction support ignore it.") - self._unload_server_models() + if config.AUDIOCPP_UNLOAD_MODELS: + self._unload_server_models() def _unload_server_models(self) -> None: """Ask the server to unload every loaded model before generating. @@ -930,6 +931,8 @@ class AudioCppTTSClient(_BaseTTSClient): first frees those leftovers; this run's model reloads transparently on its first request. Failures only warn: an older server without the endpoint, or a busy one, must not block a working setup. + Controlled by config.AUDIOCPP_UNLOAD_MODELS (the TUI Settings + "Unload models" option). """ request = urllib.request.Request( f"{self.api_url}/v1/tasks/unload_all_models", data=b"", -- cgit v1.2.3