diff options
Diffstat (limited to 'app/converter')
| -rw-r--r-- | app/converter/config.py | 7 | ||||
| -rw-r--r-- | app/converter/tts.py | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/app/converter/config.py b/app/converter/config.py index 9f70a73..6eacb41 100644 --- a/app/converter/config.py +++ b/app/converter/config.py @@ -83,3 +83,10 @@ AUDIOCPP_CLONE_MODEL_ID = "qwen" # VoiceDesign); on other families it acts as a style/delivery instruction # when the model supports one and is ignored otherwise. Empty by default. AUDIOCPP_INSTRUCTIONS = "" + +# Ask the audio.cpp server to unload all currently loaded models before +# converting, so models left resident by earlier runs free their memory +# (e.g. VRAM on GPU backends) and only the selected entry loads. Set to +# False to keep other models resident across runs (the TUI Settings menu +# exposes this as "Unload models", default Yes). +AUDIOCPP_UNLOAD_MODELS = True 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"", |
