diff options
| author | historia <historiavg@proton.me> | 2026-08-26 21:22:40 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-08-26 21:22:40 -0400 |
| commit | 477ac3e827e3bdc9f14583fc3aa8db1fa2d27c52 (patch) | |
| tree | 1e21fa5af1d7a95ffc62fb03eed153056c38ae9e /app/ui/runview.py | |
| parent | 65c6f737f1545ef225768af897acd20f163a4fb4 (diff) | |
| download | tts-audiobook-generator-477ac3e827e3bdc9f14583fc3aa8db1fa2d27c52.tar.gz | |
feat: design model support for qwen-tts backend. remove unnecessary port split for qwen models
Diffstat (limited to 'app/ui/runview.py')
| -rw-r--r-- | app/ui/runview.py | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/app/ui/runview.py b/app/ui/runview.py index 1da8690..9448c06 100644 --- a/app/ui/runview.py +++ b/app/ui/runview.py @@ -72,13 +72,17 @@ class RunConfig: conversion talks to (the name is the backends.ServerSpec name; the URL is what the monitor polls). AUTOSTART_SPEC, when not None, is the ServerSpec the worker boots first (the hub only sets it when the - server is not already running). LOG_PATH names the converter's log - file for the error screen's "details" hint. NOTICE is an optional - warning line shown under the progress panel (e.g. a foreign server - holding the managed port). STOP_AND_EXIT ("Stop server and exit after - generating") skips the finished screen entirely: the server is stopped - automatically, the TUI quits, and the results are printed to the real - terminal after curses closes. + server is not already running). RESTART_FIRST marks an autostart of a + different kind: the managed qwen server is up but hosting another + model than this run selected, so the worker stops it and boots the + spec again (with the new model's argv) before converting. LOG_PATH + names the converter's log file for the error screen's "details" hint. + NOTICE is an optional warning line shown under the progress panel + (e.g. a foreign server holding the managed port). + STOP_AND_EXIT ("Stop server and exit after generating") skips the + finished screen entirely: the server is stopped automatically, the + TUI quits, and the results are printed to the real terminal after + curses closes. """ backend: str backend_label: str @@ -89,6 +93,7 @@ class RunConfig: server_url: Optional[str] = None server_identity: Optional[str] = None autostart_spec: object = None + restart_first: bool = False log_path: str = "" notice: str = "" stop_and_exit: bool = False @@ -229,6 +234,11 @@ class RunView(ScreenView): try: with contextlib.redirect_stdout(io.StringIO()): if config.autostart_spec is not None: + if config.restart_first: + # The managed qwen server hosts another model than + # this run selected: stop it so the new model's + # argv can boot on the same port. + servers.stop(config.autostart_spec.name) ok = servers.start(config.autostart_spec, progress=self._queue.put, cancel=self._cancel) |
