aboutsummaryrefslogtreecommitdiff
path: root/app/backends/audiocpp
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-09-01 03:38:50 -0400
committerhistoria <historiavg@proton.me>2026-09-01 03:38:50 -0400
commitd15adb490b634dd22a65a1c8d7f4ec9fa74816b4 (patch)
tree8fc5da437ceffc22482968cdf7c2591c81a407cc /app/backends/audiocpp
parent058b19e7a65b40b1024a4fdeb2233062ff273cfd (diff)
downloadtts-audiobook-generator-d15adb490b634dd22a65a1c8d7f4ec9fa74816b4.tar.gz
fix: hide speech-to-speech only models from config wizard
Diffstat (limited to 'app/backends/audiocpp')
-rw-r--r--app/backends/audiocpp/catalog.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/app/backends/audiocpp/catalog.py b/app/backends/audiocpp/catalog.py
index 78908a3..1743d15 100644
--- a/app/backends/audiocpp/catalog.py
+++ b/app/backends/audiocpp/catalog.py
@@ -8,10 +8,18 @@ from typing import Dict, List, Optional, Set, Tuple
from converter.clients import AUDIOCPP_CLONE_ONLY_FAMILIES, audiocpp_family_spec_tasks
-from .constants import TASK_CLON, TASK_TTS
+from .constants import TASK_CLON, TASK_TTS, TASK_VDES
DESIGN_PACKAGE_RE = re.compile(r"voice[\s_\-]?design", re.IGNORECASE)
+# The spec task vocabulary for "can this family turn text into audio":
+# plain synthesis ("tts"), reference-voice synthesis ("clone"; specs spell
+# it out, unlike the hosted "clon" task) and described-voice synthesis
+# ("vdes"). Families whose tasks name none of these only transform audio
+# (speech-to-speech, voice conversion, ...) and are kept out of the
+# install catalog.
+NARRATION_TASKS = frozenset({TASK_TTS, "clone", TASK_VDES})
+
def request_options_families(audiocpp_dir: Path) -> Dict[str, dict]:
"""Map the families whose spec defines per-request options.
@@ -180,7 +188,15 @@ def load_model_catalog(audiocpp_dir: Path) -> List[dict]:
except (OSError, ValueError):
continue
tasks = spec.get("tasks") or []
- if "tts" not in tasks and spec.get("category") != "tts":
+ if tasks:
+ # A task list that names no text-synthesis capability means the
+ # family cannot narrate text at all (e.g. PersonaPlex:
+ # categorized "tts" but speech-to-speech only) — hosting one
+ # fails every request, so it is never offered for install.
+ if not (NARRATION_TASKS & set(tasks)):
+ continue
+ elif spec.get("category") != "tts":
+ # No task list: fall back to the category as before.
continue
family = spec.get("family") or spec_path.stem
packages = spec.get("packages") or []