diff options
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: |
