diff options
| author | historia <historiavg@proton.me> | 2026-09-09 17:02:41 -0400 |
|---|---|---|
| committer | historia <historiavg@proton.me> | 2026-09-09 17:02:41 -0400 |
| commit | 130dcd988e0554a6343c92fd45d808fd508789b3 (patch) | |
| tree | 0162c1593eff0f9214f111f600f23efd624eb3c3 /app/converter/converter.py | |
| parent | 71f2c85aa5ea2aa5fe5f31537f5979459e82fcdd (diff) | |
| download | tts-audiobook-generator-130dcd988e0554a6343c92fd45d808fd508789b3.tar.gz | |
fix: model-specific instructions support and set cfg-scale 4 for breeze automatically
Diffstat (limited to 'app/converter/converter.py')
| -rw-r--r-- | app/converter/converter.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/app/converter/converter.py b/app/converter/converter.py index 3b878c8..2b849a2 100644 --- a/app/converter/converter.py +++ b/app/converter/converter.py @@ -137,9 +137,10 @@ def voice_mode_for(backend: str, voice: Optional[str] = None, sglomni resolves from the selected model's capability — a design model takes instructions, a clone-capable model clones when a reference .wav is given and otherwise synthesizes its default voice, and a - speaker-capable model takes a preset name; qwen designs with - instructions, clones only with a reference .wav, and uses a built-in - speaker otherwise), so the hub can run the pre-flight overwrite checks + speaker-capable model takes a preset name; qwen clones with a + reference .wav, takes a built-in speaker otherwise (instructions + sent as that model's delivery control), and designs with + instructions alone), so the hub can run the pre-flight overwrite checks against exactly the output names the conversion will produce. """ if backend == BACKEND_FASTER: @@ -157,6 +158,17 @@ def voice_mode_for(backend: str, voice: Optional[str] = None, return VOICE_MODE_CUSTOM # Unresolved model (the caller resolves it later): the qwen-style # heuristic is the closest pre-flight approximation. + if backend == BACKEND_QWEN: + # Mirrors the CLI routing (audiobook.convert): a reference clone + # wins, then a built-in speaker (with instructions as that + # model's delivery control), then instructions alone (VoiceDesign). + if clone: + return VOICE_MODE_CLONE + if (voice or "").strip(): + return VOICE_MODE_CUSTOM + if (instructions or "").strip(): + return VOICE_MODE_DESIGN + return VOICE_MODE_CUSTOM if (instructions or "").strip(): return VOICE_MODE_DESIGN return VOICE_MODE_CLONE if clone else VOICE_MODE_CUSTOM |
