aboutsummaryrefslogtreecommitdiff
path: root/app/converter/tts.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-24 16:18:38 -0400
committerhistoria <historiavg@proton.me>2026-08-24 16:18:38 -0400
commit919544c0931d53bb81904b6212ff14f856549da3 (patch)
treeaef7161db4cdb43bbd572fdc6c2fa2539726f4ee /app/converter/tts.py
parent1ff9a635bd9b033b631a6b525891b7eb44e189d3 (diff)
downloadtts-audiobook-generator-919544c0931d53bb81904b6212ff14f856549da3.tar.gz
feat: option to unload models from audio.cpp per-run
Diffstat (limited to 'app/converter/tts.py')
-rw-r--r--app/converter/tts.py5
1 files changed, 4 insertions, 1 deletions
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"",