diff options
| author | historia <historiavg@proton.me> | 2026-08-24 18:57:09 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-24 18:57:09 -0400 |
| commit | 0522e73b68291af62e43c387ab8f9b8ffa2cab47 (patch) | |
| tree | 1800168c1ed5de7540624265945faba8251a7cab /app/backends/qwen.py | |
| parent | d950fc8e64ee508334e608f6045d687d73a464be (diff) | |
| download | tts-audiobook-generator-0522e73b68291af62e43c387ab8f9b8ffa2cab47.tar.gz | |
feat: configure [backend] loads existing backend config rather than just overwriting it
Diffstat (limited to 'app/backends/qwen.py')
| -rw-r--r-- | app/backends/qwen.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/app/backends/qwen.py b/app/backends/qwen.py index 7f821fa..b170eb8 100644 --- a/app/backends/qwen.py +++ b/app/backends/qwen.py @@ -22,7 +22,6 @@ sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) from backends import ( BackendStatus, - ConfigureAction, ServerSpec, common, envs, @@ -282,9 +281,23 @@ def _detect_remote(managed: bool = False): return remote_models, remote_urls -configure_actions: List[ConfigureAction] = [ - ConfigureAction("Reconfigure qwen-tts (ports/speaker)", run_tui), -] +def uninstall() -> int: + """Remove the qwen-tts backend entirely: stop its servers, pip uninstall. + + qwen-tts is a pip package (``qwen_tts`` + the ``qwen-tts-demo`` script) + installed into the managed venv, so uninstalling it removes the backend. + Any server this tool started is stopped first (best-effort). Returns the + exit code. + """ + servers.stop("qwen-custom") + servers.stop("qwen-clone") + rc = common.pip_uninstall([QWEN_PIP_PKG]) + if rc != 0: + print(f"[WARNING] pip uninstall failed (exit {rc}); remove " + f"{QWEN_PIP_PKG} from the managed venv manually") + else: + print(f"[OK] {QWEN_PIP_PKG} removed.") + return 0 def main() -> int: |
