aboutsummaryrefslogtreecommitdiff
path: root/app/backends/audiocpp/catalog.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-28 16:52:14 -0400
committerhistoria <historiavg@proton.me>2026-08-28 16:52:14 -0400
commit270fa60c01866c4431d540be960b6cd2bc2b9c44 (patch)
tree7e5b682472622634d78226479c2f1526a6efc1d3 /app/backends/audiocpp/catalog.py
parentdb38085d07ce75f8961eecdc1919e98748254c53 (diff)
downloadtts-audiobook-generator-270fa60c01866c4431d540be960b6cd2bc2b9c44.tar.gz
feat: run auto-build audio.cpp scripts for macos and windows
Diffstat (limited to 'app/backends/audiocpp/catalog.py')
-rw-r--r--app/backends/audiocpp/catalog.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/app/backends/audiocpp/catalog.py b/app/backends/audiocpp/catalog.py
index 412fdf1..5d49fac 100644
--- a/app/backends/audiocpp/catalog.py
+++ b/app/backends/audiocpp/catalog.py
@@ -2,6 +2,7 @@
import json
import re
+import sys
from pathlib import Path
from typing import Dict, List, Optional, Set, Tuple
@@ -73,9 +74,20 @@ def _backend_options(detected: Optional[str] = None
options, that option gets ``[auto-detected]`` appended and is the
default (cursor/start) selection; otherwise the first option is the
default as before. Returns (options, default_index).
+
+ On macOS only ``cpu`` is offered: Metal (via ``build_metal.sh``) is
+ the only buildable inference backend there, and it is recorded as
+ ``cpu`` (see the ``-metal-`` -> ``cpu`` mapping in ``detect_backend``
+ and ``built_server_binary``), so cuda/vulkan/hip — which cannot build
+ on macOS — never reach the build step.
"""
+ if sys.platform == "darwin":
+ label = "cpu - Apple Metal (recorded as cpu)"
+ if detected == "cpu":
+ label += " [auto-detected]"
+ return [(label, "cpu")], 0
width = max(len(name) for name, _ in _BACKEND_DESCRIPTIONS)
- options: List[Tuple[str, str]] = []
+ options = []
default_index = 0
for index, (name, desc) in enumerate(_BACKEND_DESCRIPTIONS):
label = f"{name.ljust(width)} - {desc}"