diff options
Diffstat (limited to 'app/ui')
| -rw-r--r-- | app/ui/hub.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/app/ui/hub.py b/app/ui/hub.py index 24c779f..ef41d0b 100644 --- a/app/ui/hub.py +++ b/app/ui/hub.py @@ -1163,17 +1163,25 @@ def _audiocpp_fields(stdscr, api_url: Optional[str] = None, entry.get("id") or "") def reset_voice(fields) -> None: - """Re-point the Voice field at the newly selected model's voice.""" + """Re-point the Voice field at the newly selected model's voice. + + A model switch that keeps the same voice list (two clone entries + sharing one server's voices) keeps the current pick: only a value + the new list cannot offer is re-pointed at its default. + """ voice_field = next(f for f in fields if f.get("key") == prefix + "audiocpp_voice") capability = model_capability(fields) if capability == AUDIOCPP_VOICE_DESIGN: voice_field["value"] = None - elif capability == AUDIOCPP_VOICE_SPEAKER: - voice_field["value"] = QWEN3_TTS_SPEAKERS[0] + return + if capability == AUDIOCPP_VOICE_SPEAKER: + voices = QWEN3_TTS_SPEAKERS else: # clone voices = voices_for(_field_value(fields, prefix + "model_id")) - voice_field["value"] = voices[0] if voices else "" + if voice_field.get("value") in voices: + return # the new list still offers the pick: keep it + voice_field["value"] = voices[0] if voices else "" def voice_choices(fields) -> list: capability = model_capability(fields) |
