aboutsummaryrefslogtreecommitdiff
path: root/app/backends
diff options
context:
space:
mode:
Diffstat (limited to 'app/backends')
-rwxr-xr-xapp/backends/audiocpp.py55
-rwxr-xr-xapp/backends/faster.py16
-rw-r--r--app/backends/qwen.py14
3 files changed, 29 insertions, 56 deletions
diff --git a/app/backends/audiocpp.py b/app/backends/audiocpp.py
index 31aa01d..f6121ea 100755
--- a/app/backends/audiocpp.py
+++ b/app/backends/audiocpp.py
@@ -1987,39 +1987,28 @@ def _build_audiocpp_tui(emit, cancel, argv: List[str], command: str,
return rc
-def _print_launch_hint(audiocpp_dir: Path, output_path: Path,
- pending_build: bool = False) -> None:
- """Print the exact command to start the server (or build guidance).
-
- The command is prefixed with ``cd <checkout> &&`` because the server
- discovers model_specs/<family>.json relative to its working directory.
- PENDING_BUILD is True when the server is still building in a parallel
- lane; instead of "build it first" remediation the hint then names the
- command to run once that build finishes.
+def _print_launch_hint(audiocpp_dir: Path, output_path: Path) -> None:
+ """Print remediation when audiocpp_server is missing (troubleshooting).
+
+ The hub starts and stops the server itself, so a working install gets
+ no manual launch instructions. When no binary was built, though, the
+ user needs to know how to build and run it by hand. The commands are
+ prefixed with ``cd <checkout> &&`` because the server discovers
+ model_specs/<family>.json relative to its working directory.
"""
- binary = find_audiocpp_server_bin(audiocpp_dir)
- print()
- if binary is not None:
- print("Start the server with:")
- print(f" cd {audiocpp_dir} && {binary} --config {output_path}")
- elif pending_build:
- print("The server is still building in the other panel — once it "
- "finishes, start it with:")
- print(f" cd {audiocpp_dir} && ./build/<platform>-<backend>-release"
- f"/bin/audiocpp_server --config {output_path}")
- else:
- print("[INFO] audiocpp_server binary not found. Build it first, e.g.:")
- script = find_build_script(audiocpp_dir)
- if script is not None:
- print(f" sh {script} --backend <cuda|vulkan|hip|cpu> "
- "--target audiocpp_server --deployment-build")
- print(f" then run: cd {audiocpp_dir} && ./build/<platform>-<backend>"
- f"-release/bin/audiocpp_server --config {output_path}")
+ if find_audiocpp_server_bin(audiocpp_dir) is not None:
+ return
+ print("\n[INFO] audiocpp_server binary not found. Build it first, e.g.:")
+ script = find_build_script(audiocpp_dir)
+ if script is not None:
+ print(f" sh {script} --backend <cuda|vulkan|hip|cpu> "
+ "--target audiocpp_server --deployment-build")
+ print(f" then run: cd {audiocpp_dir} && ./build/<platform>-<backend>"
+ f"-release/bin/audiocpp_server --config {output_path}")
def _execute_lanes(settings: dict,
- args: argparse.Namespace,
- parallel: bool = False) -> List[taskview.TaskLane]:
+ args: argparse.Namespace) -> List[taskview.TaskLane]:
"""Build the ordered setup steps for the in-TUI task view, per lane.
The same work ``_execute`` runs on the console, split into two lanes so
@@ -2031,8 +2020,7 @@ def _execute_lanes(settings: dict,
dict scoped to the models lane. Each step's ``work(emit, cancel)``
returns its exit code; subprocess steps stream through EMIT and abort on
CANCEL, while print()-based steps are captured by the view's stdout
- routing. PARALLEL marks the launch hint as concurrent-with-build so it
- does not claim the binary is missing while the build is still running.
+ routing.
"""
audiocpp_dir = settings["audiocpp_dir"]
state: dict = {}
@@ -2102,8 +2090,7 @@ def _execute_lanes(settings: dict,
def install(emit, cancel):
_install_models(audiocpp_dir, settings["install_guidance"],
settings["download"], emit=emit, cancel=cancel)
- _print_launch_hint(audiocpp_dir, settings["output_path"],
- pending_build=bool(build and parallel))
+ _print_launch_hint(audiocpp_dir, settings["output_path"])
return 0
install_title = "Download models" if settings.get("download") \
else "Print model install commands"
@@ -2163,7 +2150,7 @@ def setup_screen(stdscr) -> int:
if settings is None:
return 1
return taskview.run_lanes(stdscr, "Setting up audio.cpp",
- _execute_lanes(settings, args, parallel=True))
+ _execute_lanes(settings, args))
def build_screen(stdscr) -> int:
diff --git a/app/backends/faster.py b/app/backends/faster.py
index 8c64183..7ac4dce 100755
--- a/app/backends/faster.py
+++ b/app/backends/faster.py
@@ -428,15 +428,15 @@ def _execute(settings: dict) -> int:
def _print_launch_hint(voices_path: Path, port: int) -> None:
- print()
+ """Remediation only (troubleshooting): what's missing when not cloned.
+
+ The hub starts and stops the server itself, so a working install gets
+ no manual launch instructions.
+ """
if _is_cloned():
- py = envs.env_python()
- print("Start the server with (or use the hub's 'Server' menu):")
- print(f" {py} {_checkout()}/examples/openai_server.py "
- f"--voices {voices_path} --port {port}")
- else:
- print("[INFO] Clone faster-qwen3-tts to get examples/openai_server.py,")
- print(f" then run it with --voices {voices_path} --port {port}")
+ return
+ print("[INFO] Clone faster-qwen3-tts to get examples/openai_server.py,")
+ print(f" then run it with --voices {voices_path} --port {port}")
def setup_screen(stdscr) -> int:
diff --git a/app/backends/qwen.py b/app/backends/qwen.py
index c6a11bf..cc84f8e 100644
--- a/app/backends/qwen.py
+++ b/app/backends/qwen.py
@@ -189,8 +189,6 @@ def _execute_steps(settings: dict) -> List[taskview.TaskStep]:
else:
print("[WARNING] Could not update SPEAKER; edit "
"app/converter/config.py by hand")
-
- _print_launch_hint(settings["custom_port"], settings["clone_port"])
return 0
steps.append(taskview.TaskStep("Sync config & ports", sync))
@@ -202,18 +200,6 @@ def _execute(settings: dict) -> int:
return taskview.run_steps_inline(_execute_steps(settings))
-def _print_launch_hint(custom_port: int, clone_port: int) -> None:
- demo = envs.env_script("qwen-tts-demo")
- print()
- print("Start the servers (in separate terminals), or use the hub's")
- print("'Server' menu / let a conversion start one automatically:")
- print(f" {demo} {QWEN_CUSTOMVOICE_MODEL} --ip 127.0.0.1 "
- f"--port {custom_port}")
- print(f" {demo} {QWEN_BASE_MODEL} --ip 127.0.0.1 "
- f"--port {clone_port}")
- print("Then run: python audiobook.py --backend qwen")
-
-
def setup_screen(stdscr) -> int:
"""Run the setup wizard on an existing curses screen (the hub's).