Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: read chat replies aloud in a saved Audio voice (#12819)
Etherl7da8ab5e96b6
diff --git a/studio/backend/models/inference.py b/studio/backend/models/inference.pyindex 055a5ef4442..f780c0309fe 100644--- a/studio/backend/models/inference.py+++ b/studio/backend/models/inference.py@@ -5371,6 +5371,22 @@ class AudioSpeechVoice(BaseModel):id: str = Field(..., pattern = _AUDIO_ID_PATTERN)+class AudioGenerateRequest(ChatCompletionRequest):+ """``POST /audio/generate``: speak the last user message, as chat's read aloud does."""++ voice_id: Optional[str] = Field(+ None,+ pattern = _AUDIO_ID_PATTERN,+ description = (+ "[x-unsloth] A saved voice to speak in, as the Audio page's Speak does; the loaded "+ "model must clone. Language, instructions, options, seed and the token cap apply."+ ),+ )+ persist: bool = Field(+ True, description = "[x-unsloth] Keep the clip in Audio history. Read aloud sends false."+ )++class AudioRunInputs(BaseModel):model_config = ConfigDict(extra = "forbid")diff --git a/studio/backend/routes/inference.py b/studio/backend/routes/inference.pyindex 1c131b609ed..583b940bf3a 100644--- a/studio/backend/routes/inference.py+++ b/studio/backend/routes/inference.py@@ -3701,6 +3701,7 @@ from models.inference import (AudioGalleryFlagsPatch,AudioGalleryItem,AudioGalleryListResponse,+ AudioGenerateRequest,AudioInputRecord,AudioInputTranscribeRequest,AudioInputTranscript,@@ -22577,7 +22578,7 @@ async def audio_download_plan(@router.post("/audio/generate")async def generate_audio(- payload: ChatCompletionRequest,+ payload: AudioGenerateRequest,request: Request,current_subject: str = Depends(get_current_subject),):@@ -22611,22 +22612,55 @@ async def generate_audio(if not last_user_msg:raise HTTPException(status_code = 400, detail = "No user message found.")text = last_user_msg["content"]+ # /chat/completions hands its own request here: no saved voice, and the clip is kept.+ voice_id = payload.voice_id if isinstance(payload, AudioGenerateRequest) else None+ persist = payload.persist if isinstance(payload, AudioGenerateRequest) else True++ run = None+ if voice_id:+ from fastapi.exceptions import RequestValidationError+ from pydantic import ValidationError++ # Built before the monitor opens a row, so a bad request records no failure.+ try:+ run = AudioRunRequest(+ workflow = "speak",+ text = text,+ language = payload.audio_language,+ instructions = payload.audio_instructions,+ inputs = AudioRunInputs(reference = AudioSourceRef(voice_id = voice_id)),+ options = payload.audio_options,+ seed = payload.seed,+ max_tokens = _effective_max_tokens(payload),+ )+ except ValidationError as exc:+ raise RequestValidationError(exc.errors()) from Nonetts_stats: dict = {}- generate = lambda: _generate_tts_wav( # noqa: E731- text,- payload,- request,- current_subject,+ tts_kwargs = {# ``or`` like /v1/audio/speech: an explicitly empty model is accepted by the# request model, and without this it stops the hook at its falsey check before# the idle-stash restore, failing a request the sibling route serves.- requested_model = _switch_model_for_payload(payload) or _RELOAD_ONLY_MODEL,- stats_holder = tts_stats,- )+ "requested_model": _switch_model_for_payload(payload) or _RELOAD_ONLY_MODEL,+ "stats_holder": tts_stats,+ }++ async def generate():+ if run is not None:+ return await _speak(run, request, current_subject, persist = persist, **tts_kwargs)+ wav_bytes, sample_rate, model_name, audio_type = await _generate_tts_wav(+ text, payload, request, current_subject, **tts_kwargs+ )+ record = None+ if persist:+ record = await asyncio.to_thread(+ _persist_tts_clip, wav_bytes, sample_rate, text, model_name, audio_type+ )+ return record, wav_bytes, sample_rate, model_name+# Chat completions monitors the turns it hands here, and the chat's read-aloud is no API traffic.if getattr(getattr(request, "url", None), "path", "").rstrip("/") != "/v1/audio/generate":- wav_bytes, sample_rate, model_name, audio_type = await generate()+ persisted_clip, wav_bytes, sample_rate, model_name = await generate()else:async with _monitored_media_request(request,@@ -22634,12 +22668,9 @@ async def generate_audio(prompt = text,subject = current_subject,) as monitor_id:- wav_bytes, sample_rate, model_name, audio_type = await generate()+ persisted_clip, wav_bytes, sample_rate, model_name = await generate()api_monitor.relabel(monitor_id, model_name)truncated = bool((tts_stats.get("stats") or {}).get("truncated"))- persisted_clip = await asyncio.to_thread(- _persist_tts_clip, wav_bytes, sample_rate, text, model_name, audio_type- )audio_b64 = base64.b64encode(wav_bytes).decode("ascii")return JSONResponse(@@ -23320,10 +23351,16 @@ async def _dispatch_audio_run(async def _speak(- body: AudioRunRequest, request: Request, current_subject: str, **tts_kwargs+ body: AudioRunRequest,+ request: Request,+ current_subject: str,+ *,+ persist: bool = True,+ **tts_kwargs,) -> tuple[Optional[dict[str, Any]], bytes, int, str]:- """Clone, or Speak in a saved voice, and keep the clip in history; shared by /audio/run and- /audio/speech. ``(record, wav_bytes, sample_rate, model_name)``."""+ """Clone, or Speak in a saved voice, and keep the clip in history unless ``persist`` is off;+ shared by /audio/run, /audio/speech and /audio/generate. ``(record, wav_bytes, sample_rate,+ model_name)``."""from core.inference import audio_inputsif body.workflow == "clone" and body.inputs.reference is None:@@ -23372,6 +23409,8 @@ async def _speak(},**tts_kwargs,)+ if not persist:+ return None, wav_bytes, sample_rate, model_nameextra_meta: dict[str, Any] = {"role": "output","settings": _audio_run_settings(body, reference_text is not None),diff --git a/studio/backend/tests/test_audio_run_route.py b/studio/backend/tests/test_audio_run_route.pyindex 7385e3a5826..7c8c7599fa8 100644--- a/studio/backend/tests/test_audio_run_route.py+++ b/studio/backend/tests/test_audio_run_route.py@@ -1416,6 +1416,80 @@ def test_speak_in_a_saved_voice_on_a_speak_and_clone_model(stub, tmp_path):assert meta["voice_id"] == voice["id"] and meta["workflow"] == "speak"+def _history(tmp_path, account):+ return sorted((tmp_path / "accounts" / account.account_id / "audio").glob("*.wav"))+++def _generate(client, **body):+ payload = {"messages": [{"role": "user", "content": "Read me aloud."}], **body}+ return client.post("/api/inference/audio/generate", json = payload)++[email protected]("persist", [True, False])+def test_read_aloud_keeps_nothing_in_history_and_generate_still_does(stub, tmp_path, persist):+ stub["use"](*_KOKORO)+ with _client(ALICE) as client:+ response = _generate(client, **({} if persist else {"persist": False}))+ assert response.status_code == 200, response.text+ body = response.json()+ assert base64.b64decode(body["audio"]["data"])[:4] == b"RIFF"+ assert (body["clip_id"] is not None) is persist+ assert len(_history(tmp_path, ALICE)) == (1 if persist else 0)++[email protected]("persist", [True, False])+def test_read_aloud_speaks_in_a_saved_voice(stub, tmp_path, persist):+ backend = stub["use"](+ "audio-cpp/audio.cpp-gguf/VoxCPM2-GGUF",+ _clone_info(workflows = ("speak", "clone"), reference_text = "optional"),+ )+ voice = _voice(ALICE, _input(ALICE), transcript = "Okay, I'm Cemo.")+ with _client(ALICE) as client:+ response = _generate(client, voice_id = voice["id"], persist = persist)+ assert response.status_code == 200, response.text+ (call,) = backend.calls+ assert call["workflow"] == "speak" and call["reference_text"] == "Okay, I'm Cemo."+ reference = Path(call["audio_inputs"]["reference"])+ assert reference.parent == _inputs_root(tmp_path)+ assert reference.name.startswith(f"v-{voice['id']}.")+ assert base64.b64decode(response.json()["audio"]["data"])[:4] == b"RIFF"+ assert len(_history(tmp_path, ALICE)) == (1 if persist else 0)+++def test_a_saved_voice_keeps_the_request_settings(stub):+ backend = stub["use"](+ "audio-cpp/audio.cpp-gguf/VoxCPM2-GGUF",+ _clone_info(workflows = ("speak", "clone"), reference_text = "optional"),+ )+ voice = _voice(ALICE, _input(ALICE))+ with _client(ALICE) as client:+ response = _generate(+ client, voice_id = voice["id"], seed = 7, audio_language = "English", max_tokens = 50+ )+ empty = client.post(+ "/api/inference/audio/generate",+ json = {"messages": [{"role": "user", "content": ""}], "voice_id": voice["id"]},+ )+ assert response.status_code == 200, response.text+ (call,) = backend.calls+ assert (call["seed"], call["language"]) == (7, "English")+ assert call["max_new_tokens"] <= 50+ assert empty.status_code == 422, empty.text+++def test_read_aloud_voice_refusals(stub):+ voice = _voice(ALICE, _input(ALICE))+ with _client(BOB) as client:+ assert _generate(client, voice_id = voice["id"]).status_code == 404+ stub["use"](*_KOKORO)+ with _client(ALICE) as client:+ refused = _generate(client, voice_id = voice["id"])+ assert refused.status_code == 400+ assert refused.json()["detail"] == "Load a model that can clone a voice."+ assert _generate(client, voice_id = "../voice").status_code == 422+ assert stub["backend"].calls == []++def _wav_params(path):import wavewith wave.open(str(path)) as w:@@ -1883,6 +1957,20 @@ def test_a_v1_run_is_monitored_and_its_clips_are_served_under_v1(stub):)+def test_a_bad_v1_generate_in_a_saved_voice_opens_no_monitor_row(stub):+ from core.inference.api_monitor import api_monitor++ voice = _voice(ALICE, _input(ALICE))+ api_monitor.clear()+ with _v1(ALICE) as client:+ response = client.post(+ "/v1/audio/generate",+ json = {"messages": [{"role": "user", "content": ""}], "voice_id": voice["id"]},+ )+ assert 400 <= response.status_code < 500, response.text+ assert api_monitor.snapshot(include_details = False) == []++@pytest.mark.parametrize("as_object", [False, True])def test_speech_in_a_saved_voice_clones_with_its_transcript(stub, tmp_path, as_object):voice = _voice(ALICE, _input(ALICE), transcript = "Okay, I'm Cemo.")diff --git a/studio/frontend/src/features/chat/adapters/studio-speech-synthesis-adapter.ts b/studio/frontend/src/features/chat/adapters/studio-speech-synthesis-adapter.tsindex cc480112cb7..74ac725bdcb 100644--- a/studio/frontend/src/features/chat/adapters/studio-speech-synthesis-adapter.ts+++ b/studio/frontend/src/features/chat/adapters/studio-speech-synthesis-adapter.ts@@ -222,12 +222,16 @@ export async function generateStudioTtsAudio(text: string,signal?: AbortSignal,): Promise<string> {+ const { ttsStudioVoiceId } = useVoiceSettingsStore.getState();const response = await authFetch("/api/inference/audio/generate", {method: "POST",headers: { "Content-Type": "application/json" },body: JSON.stringify({messages: [{ role: "user", content: text }],stream: false,+ // Read aloud is not a Speak run, so it stays out of Speak's history.+ persist: false,+ ...(ttsStudioVoiceId ? { voice_id: ttsStudioVoiceId } : {}),}),signal,});@@ -238,7 +242,20 @@ export async function generateStudioTtsAudio(const detail = body?.detail ?? `HTTP ${response.status}`;if (/no model loaded|not an audio model/i.test(detail)) {throw new Error(- "No TTS model is loaded. Load an audio model (e.g. Orpheus TTS) from the model selector, then try again.",+ "No speech model is loaded. Open Audio and load one in Speak, then try again.",+ );+ }+ // Only this 404 is about the voice; another one (a model hidden from the account) must not+ // drop the user's choice.+ if (ttsStudioVoiceId && /saved voice no longer exists/i.test(detail)) {+ useVoiceSettingsStore.getState().setTtsStudioVoiceId("");+ throw new Error(+ "The saved voice for read aloud no longer exists. Read aloud now uses the model's own voice.",+ );+ }+ if (ttsStudioVoiceId && /can clone a voice/i.test(detail)) {+ throw new Error(+ "The loaded model can't use saved voices. Load a voice-cloning model in Audio, or choose Model's own voice in Settings → Voice.",);}throw new Error(detail);diff --git a/studio/frontend/src/features/settings/stores/voice-settings-store.ts b/studio/frontend/src/features/settings/stores/voice-settings-store.tsindex 8826bf6df54..a376b244eae 100644--- a/studio/frontend/src/features/settings/stores/voice-settings-store.ts+++ b/studio/frontend/src/features/settings/stores/voice-settings-store.ts@@ -165,6 +165,10 @@ export interface VoiceSettingsState {ttsProviderVoice: string;setTtsProviderVoice: (value: string) => void;+ /** Saved Audio voice id the "studio" engine speaks in; "" for the model's own voice. */+ ttsStudioVoiceId: string;+ setTtsStudioVoiceId: (value: string) => void;+/** speechSynthesis voiceURI, or "default" for the system voice. */ttsVoiceURI: string;setTtsVoiceURI: (value: string) => void;@@ -342,6 +346,9 @@ export const useVoiceSettingsStore = create<VoiceSettingsState>()(ttsProviderVoice: "",setTtsProviderVoice: (ttsProviderVoice) => set({ ttsProviderVoice }),+ ttsStudioVoiceId: "",+ setTtsStudioVoiceId: (ttsStudioVoiceId) => set({ ttsStudioVoiceId }),+ttsVoiceURI: "default",setTtsVoiceURI: (ttsVoiceURI) => set({ ttsVoiceURI }),@@ -401,6 +408,7 @@ export const useVoiceSettingsStore = create<VoiceSettingsState>()(ttsProviderId: asString(saved?.ttsProviderId, ""),ttsProviderModel: asString(saved?.ttsProviderModel, ""),ttsProviderVoice: asString(saved?.ttsProviderVoice, ""),+ ttsStudioVoiceId: asString(saved?.ttsStudioVoiceId, ""),ttsVoiceURI: asString(saved?.ttsVoiceURI, "default"),ttsRate: clampNumber(saved?.ttsRate, 0.5, 2, 1),ttsPitch: clampNumber(saved?.ttsPitch, 0, 2, 1),diff --git a/studio/frontend/src/features/settings/tabs/voice-tab.tsx b/studio/frontend/src/features/settings/tabs/voice-tab.tsxindex 2ff0926a25a..acc2354672e 100644--- a/studio/frontend/src/features/settings/tabs/voice-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/voice-tab.tsx@@ -12,12 +12,14 @@ import {Select,SelectContent,SelectItem,+ SelectSeparator,SelectTrigger,SelectValue,} from "@/components/ui/select";import { Slider } from "@/components/ui/slider";import { Spinner } from "@/components/ui/spinner";import { Switch } from "@/components/ui/switch";+import { useAudioVoicesStore } from "@/features/audio/stores/audio-voices-store";import {type SttDownloadStatus,StudioModelDictationAdapter,@@ -435,6 +437,12 @@ export function VoiceTab() {const setTtsEngine = useVoiceSettingsStore((s) => s.setTtsEngine);const ttsVoiceURI = useVoiceSettingsStore((s) => s.ttsVoiceURI);const setTtsVoiceURI = useVoiceSettingsStore((s) => s.setTtsVoiceURI);+ const ttsStudioVoiceId = useVoiceSettingsStore((s) => s.ttsStudioVoiceId);+ const setTtsStudioVoiceId = useVoiceSettingsStore(+ (s) => s.setTtsStudioVoiceId,+ );+ const savedVoices = useAudioVoicesStore((s) => s.voices);+ const savedVoicesListed = useAudioVoicesStore((s) => s.loaded && !s.error);const ttsProviderId = useVoiceSettingsStore((s) => s.ttsProviderId);const setTtsProviderId = useVoiceSettingsStore((s) => s.setTtsProviderId);const ttsProviderModel = useVoiceSettingsStore((s) => s.ttsProviderModel);@@ -508,6 +516,28 @@ export function VoiceTab() {const effectiveTtsEngine: TtsEngine =ttsEngine === "system" && !systemTtsSupported ? "studio" : ttsEngine;+ // Voices saved on the Audio page since the last visit show up without a reload.+ useEffect(() => {+ if (effectiveTtsEngine === "studio") {+ void useAudioVoicesStore.getState().refresh();+ }+ }, [effectiveTtsEngine]);++ // A deleted voice would otherwise stay selected and every read aloud would fail on it.+ const hasSelectedStudioVoice = savedVoices.some(+ (voice) => voice.id === ttsStudioVoiceId,+ );+ useEffect(() => {+ if (ttsStudioVoiceId && savedVoicesListed && !hasSelectedStudioVoice) {+ setTtsStudioVoiceId("");+ }+ }, [+ hasSelectedStudioVoice,+ savedVoicesListed,+ setTtsStudioVoiceId,+ ttsStudioVoiceId,+ ]);+// Local STT stays on-demand. Track its phase without fetching model weights.type SttPhase =| "idle"@@ -1407,30 +1437,70 @@ export function VoiceTab() {</SettingsRow></>) : effectiveTtsEngine === "studio" ? (- <SettingsRow- label={t("settings.voice.readAloud.modelLabel")}- description={t("settings.voice.readAloud.modelDescription")}- >- {/* The row named the model selector but offered no way to reach it. */}- <Button- variant="outline"- size="sm"- onClick={() => {- useSettingsDialogStore.getState().closeDialog();- // Audio keeps the mode it was left in, so name the TTS task.- void navigate({- to: "/audio",- search: { task: "text-to-speech" },- });- }}+ <>+ <SettingsRow+ label={t("settings.voice.readAloud.modelLabel")}+ description={t("settings.voice.readAloud.modelDescription")}>- <HugeiconsIcon- icon={AudioWave01Icon}- className="mr-1.5 size-3.5"- />- {t("settings.voice.readAloud.openAudioAction")}- </Button>- </SettingsRow>+ {/* The row named the model selector but offered no way to reach it. */}+ <Button+ variant="outline"+ size="sm"+ onClick={() => {+ useSettingsDialogStore.getState().closeDialog();+ // Audio keeps the mode it was left in, so name the TTS task.+ void navigate({+ to: "/audio",+ search: { task: "text-to-speech" },+ });+ }}+ >+ <HugeiconsIcon+ icon={AudioWave01Icon}+ className="mr-1.5 size-3.5"+ />+ {t("settings.voice.readAloud.openAudioAction")}+ </Button>+ </SettingsRow>+ <SettingsRow+ label={t("settings.voice.readAloud.voiceLabel")}+ description={t(+ "settings.voice.readAloud.studioVoiceDescription",+ )}+ >+ <Select+ value={ttsStudioVoiceId || "model"}+ onValueChange={(value) =>+ setTtsStudioVoiceId(value === "model" ? "" : value)+ }+ >+ <SelectTrigger+ aria-label={t("settings.voice.readAloud.voiceLabel")}+ className="min-w-56 max-w-72"+ size="sm"+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent className="max-h-[min(--spacing(72),var(--radix-select-content-available-height))]">+ <SelectItem value="model">+ {t("settings.voice.readAloud.studioVoiceDefault")}+ </SelectItem>+ {savedVoices.length > 0 ? <SelectSeparator /> : null}+ {savedVoices.map((voice) => (+ <SelectItem key={voice.id} value={voice.id}>+ {voice.name}+ </SelectItem>+ ))}+ {/* Until the list loads, or if it fails, keep the stored choice visible. */}+ {ttsStudioVoiceId && !hasSelectedStudioVoice ? (+ <SelectItem value={ttsStudioVoiceId}>+ {t("settings.voice.readAloud.studioVoiceSaved")}+ </SelectItem>+ ) : null}+ </SelectContent>+ </Select>+ </SettingsRow>+ </>) : (<SettingsRowlabel={t("settings.voice.readAloud.voiceLabel")}diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex 98e32b20b75..415a22db20c 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -1412,8 +1412,7 @@ export const ar = {buttonDescription: "إظهاره في ردود المساعد",engineLabel: "محرك TTS",engineSystemDescription: "الأصوات المدمجة في الجهاز",- engineStudioDescription:- "يستخدم النموذج الصوتي المُحمَّل (مثل Orpheus)",+ engineStudioDescription: "يستخدم النموذج الصوتي المُحمَّل في قسم الصوت",engineSystem: "أصوات النظام",engineStudio: "تحميل نموذج TTS",engineCustom: "نقطة نهاية مخصصة",@@ -1428,10 +1427,14 @@ export const ar = {"اسم الصوت الذي تتوقعه نقطة النهاية؛ القيمة الافتراضية alloy",modelLabel: "نموذج TTS",modelDescription:- "حمّل نموذجًا صوتيًا من محدّد النماذج (مثل Orpheus TTS)",+ "حمّل نموذجًا صوتيًا في قسم الصوت. سيحلّ محل نموذج الدردشة.",openAudioAction: "فتح الصوت",voiceLabel: "الصوت",voiceDescription: "أفضل الأصوات على هذا الجهاز",+ studioVoiceDescription:+ "الأصوات المحفوظة في قسم الصوت تحتاج إلى نموذج استنساخ",+ studioVoiceDefault: "صوت النموذج نفسه",+ studioVoiceSaved: "صوت محفوظ",speedLabel: "السرعة",pitchLabel: "طبقة الصوت",volumeLabel: "مستوى الصوت",diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex b46a42d1a1b..5700f95beb2 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -1424,8 +1424,7 @@ export const de = {buttonDescription: "Bei Assistentenantworten anzeigen",engineLabel: "TTS-Engine",engineSystemDescription: "Auf dem Gerät integrierte Stimmen",- engineStudioDescription:- "Verwendet das geladene Audiomodell (z. B. Orpheus)",+ engineStudioDescription: "Verwendet das in Audio geladene Sprachmodell",engineSystem: "Systemstimmen",engineStudio: "TTS-Modell laden",engineCustom: "Eigener Endpunkt",@@ -1440,10 +1439,14 @@ export const de = {"Vom Endpunkt erwarteter Stimmenname; Standard ist alloy",modelLabel: "TTS-Modell",modelDescription:- "Laden Sie ein Audiomodell über die Modellauswahl (z. B. Orpheus TTS)",+ "Laden Sie ein Sprachmodell in Audio. Es ersetzt das Chat-Modell.",openAudioAction: "Audio öffnen",voiceLabel: "Stimme",voiceDescription: "Beste Stimmen auf diesem Gerät",+ studioVoiceDescription:+ "In Audio gespeicherte Stimmen erfordern ein Klonmodell",+ studioVoiceDefault: "Eigene Stimme des Modells",+ studioVoiceSaved: "Gespeicherte Stimme",speedLabel: "Geschwindigkeit",pitchLabel: "Tonhöhe",volumeLabel: "Lautstärke",diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 037e55559f1..ef364165212 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -1459,7 +1459,7 @@ export const en = {buttonDescription: "Show on assistant responses",engineLabel: "TTS engine",engineSystemDescription: "Built-in device voices",- engineStudioDescription: "Uses the loaded audio model (e.g. Orpheus)",+ engineStudioDescription: "Uses the speech model loaded in Audio",engineSystem: "System voices",engineStudio: "Load TTS model",engineCustom: "Custom endpoint",@@ -1473,10 +1473,13 @@ export const en = {customVoiceDescription: "Voice name the endpoint expects; defaults to alloy",modelLabel: "TTS model",modelDescription:- "Load an audio model from the model selector (e.g. Orpheus TTS)",+ "Load a speech model in Audio. It replaces the chat model.",openAudioAction: "Open Audio",voiceLabel: "Voice",voiceDescription: "Best voices on this device",+ studioVoiceDescription: "Voices saved in Audio need a cloning model",+ studioVoiceDefault: "Model's own voice",+ studioVoiceSaved: "Saved voice",speedLabel: "Speed",pitchLabel: "Pitch",volumeLabel: "Volume",diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex d80657d0d06..116fd361031 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -1421,8 +1421,7 @@ export const es = {buttonDescription: "Mostrar en las respuestas del asistente",engineLabel: "Motor de TTS",engineSystemDescription: "Voces integradas del dispositivo",- engineStudioDescription:- "Usa el modelo de audio cargado (por ejemplo, Orpheus)",+ engineStudioDescription: "Usa el modelo de voz cargado en Audio",engineSystem: "Voces del sistema",engineStudio: "Cargar un modelo de TTS",engineCustom: "Endpoint personalizado",@@ -1437,10 +1436,14 @@ export const es = {"Nombre de la voz que espera el endpoint; el valor predeterminado es alloy",modelLabel: "Modelo de TTS",modelDescription:- "Carga un modelo de audio desde el selector de modelos (por ejemplo, Orpheus TTS)",+ "Carga un modelo de voz en Audio. Sustituye al modelo del chat.",openAudioAction: "Abrir Audio",voiceLabel: "Voz",voiceDescription: "Las mejores voces de este dispositivo",+ studioVoiceDescription:+ "Las voces guardadas en Audio requieren un modelo de clonación",+ studioVoiceDefault: "Voz propia del modelo",+ studioVoiceSaved: "Voz guardada",speedLabel: "Velocidad",pitchLabel: "Tono",volumeLabel: "Volumen",diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex c5d11f87115..7e7792b894f 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -1423,8 +1423,7 @@ export const fr = {buttonDescription: "Afficher dans les réponses de l’assistant",engineLabel: "Moteur TTS",engineSystemDescription: "Voix intégrées à l'appareil",- engineStudioDescription:- "Utilise le modèle audio chargé (par exemple Orpheus)",+ engineStudioDescription: "Utilise le modèle vocal chargé dans Audio",engineSystem: "Voix du système",engineStudio: "Charger un modèle TTS",engineCustom: "Endpoint personnalisé",@@ -1439,10 +1438,14 @@ export const fr = {"Nom de la voix attendu par l'endpoint ; alloy par défaut",modelLabel: "Modèle TTS",modelDescription:- "Chargez un modèle audio depuis le sélecteur de modèles (par exemple Orpheus TTS)",+ "Chargez un modèle vocal dans Audio. Il remplace le modèle de chat.",openAudioAction: "Ouvrir Audio",voiceLabel: "Voix",voiceDescription: "Meilleures voix sur cet appareil",+ studioVoiceDescription:+ "Les voix enregistrées dans Audio nécessitent un modèle de clonage",+ studioVoiceDefault: "Voix propre du modèle",+ studioVoiceSaved: "Voix enregistrée",speedLabel: "Vitesse",pitchLabel: "Hauteur",volumeLabel: "Volume",diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.tsindex b852a410a10..45881485480 100644--- a/studio/frontend/src/i18n/locales/he.ts+++ b/studio/frontend/src/i18n/locales/he.ts@@ -1508,7 +1508,7 @@ export const he = {buttonDescription: "הצג בתשובות העוזר",engineLabel: "מנוע TTS",engineSystemDescription: "קולות מובנים במכשיר",- engineStudioDescription: "משתמש במודל האודיו הנטען (למשל Orpheus)",+ engineStudioDescription: "משתמש במודל הדיבור שנטען באודיו",engineSystem: "קולות מערכת",engineStudio: "טען מודל TTS",engineCustom: "נקודת קצה מותאמת אישית",@@ -1521,10 +1521,13 @@ export const he = {customVoiceDescription:"שם הקול שנקודת הקצה מצפה לו; ברירת מחדל היא alloy",modelLabel: "מודל TTS",- modelDescription: "טען מודל אודיו מבורר המודלים (למשל Orpheus TTS)",+ modelDescription: "טען מודל דיבור באודיו. הוא מחליף את מודל הצ'אט.",openAudioAction: "פתח אודיו",voiceLabel: "קול",voiceDescription: "הקולות הטובים ביותר במכשיר זה",+ studioVoiceDescription: "קולות שנשמרו באודיו דורשים מודל שיבוט",+ studioVoiceDefault: "הקול של המודל עצמו",+ studioVoiceSaved: "קול שמור",speedLabel: "מהירות",pitchLabel: "גובה צליל",volumeLabel: "עוצמת שמע",diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex 8c6919901a7..2492b61532e 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -1418,8 +1418,7 @@ export const hi = {buttonDescription: "असिस्टेंट के जवाबों पर दिखाएँ",engineLabel: "TTS इंजन",engineSystemDescription: "डिवाइस की अंतर्निहित आवाज़ें",- engineStudioDescription:- "लोड किए गए ऑडियो मॉडल का उपयोग करता है (जैसे Orpheus)",+ engineStudioDescription: "ऑडियो में लोड किए गए स्पीच मॉडल का उपयोग करता है",engineSystem: "सिस्टम की आवाज़ें",engineStudio: "TTS मॉडल लोड करें",engineCustom: "कस्टम एंडपॉइंट",@@ -1433,10 +1432,14 @@ export const hi = {"एंडपॉइंट द्वारा अपेक्षित वॉइस नाम; डिफ़ॉल्ट alloy है",modelLabel: "TTS मॉडल",modelDescription:- "मॉडल सिलेक्टर से एक ऑडियो मॉडल लोड करें (जैसे Orpheus TTS)",+ "ऑडियो में एक स्पीच मॉडल लोड करें। यह चैट मॉडल की जगह ले लेता है।",openAudioAction: "ऑडियो खोलें",voiceLabel: "आवाज़",voiceDescription: "इस डिवाइस पर सबसे अच्छी आवाज़ें",+ studioVoiceDescription:+ "ऑडियो में सहेजी गई आवाज़ों के लिए क्लोनिंग मॉडल चाहिए",+ studioVoiceDefault: "मॉडल की अपनी आवाज़",+ studioVoiceSaved: "सहेजी गई आवाज़",speedLabel: "गति",pitchLabel: "पिच",volumeLabel: "वॉल्यूम",diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex d04604f4469..9f07f487c99 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -1380,7 +1380,7 @@ export const it = {buttonDescription: "Mostralo nelle risposte dell'assistente",engineLabel: "Motore TTS",engineSystemDescription: "Voci integrate nel dispositivo",- engineStudioDescription: "Usa il modello audio caricato (es. Orpheus)",+ engineStudioDescription: "Usa il modello vocale caricato in Audio",engineSystem: "Voci di sistema",engineStudio: "Carica un modello TTS",engineCustom: "Endpoint personalizzato",@@ -1395,10 +1395,14 @@ export const it = {"Nome della voce atteso dall'endpoint; il valore predefinito è alloy",modelLabel: "Modello TTS",modelDescription:- "Carica un modello audio dal selettore dei modelli (es. Orpheus TTS)",+ "Carica un modello vocale in Audio. Sostituisce il modello della chat.",openAudioAction: "Apri Audio",voiceLabel: "Voce",voiceDescription: "Le migliori voci disponibili su questo dispositivo",+ studioVoiceDescription:+ "Le voci salvate in Audio richiedono un modello di clonazione",+ studioVoiceDefault: "Voce propria del modello",+ studioVoiceSaved: "Voce salvata",speedLabel: "Velocità",pitchLabel: "Tono",volumeLabel: "Volume",diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex 9c8015883dd..be53e905c01 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -1417,8 +1417,7 @@ export const ja = {buttonDescription: "アシスタントの応答に表示します",engineLabel: "TTS エンジン",engineSystemDescription: "デバイス内蔵の音声",- engineStudioDescription:- "読み込み済みの音声モデルを使用します (例: Orpheus)",+ engineStudioDescription: "音声で読み込んだ音声合成モデルを使用します",engineSystem: "システムの音声",engineStudio: "TTS モデルを読み込む",engineCustom: "カスタムエンドポイント",@@ -1432,10 +1431,13 @@ export const ja = {customVoiceDescription: "エンドポイントが期待する音声名(デフォルトは alloy)",modelLabel: "TTS モデル",modelDescription:- "モデルセレクターから音声モデルを読み込んでください (例: Orpheus TTS)",+ "音声で音声合成モデルを読み込んでください。チャットモデルは置き換えられます。",openAudioAction: "音声を開く",voiceLabel: "音声",voiceDescription: "このデバイスで最適な音声",+ studioVoiceDescription: "音声に保存したボイスにはクローン対応モデルが必要です",+ studioVoiceDefault: "モデル自身の音声",+ studioVoiceSaved: "保存したボイス",speedLabel: "速度",pitchLabel: "ピッチ",volumeLabel: "音量",diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex e0ff7e85ef3..c191187f654 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -1414,7 +1414,7 @@ export const ko = {buttonDescription: "어시스턴트 응답에 표시",engineLabel: "TTS 엔진",engineSystemDescription: "기기 내장 음성",- engineStudioDescription: "로드된 오디오 모델을 사용합니다(예: Orpheus)",+ engineStudioDescription: "오디오에서 로드된 음성 모델을 사용합니다",engineSystem: "시스템 음성",engineStudio: "TTS 모델 로드",engineCustom: "사용자 지정 엔드포인트",@@ -1428,10 +1428,13 @@ export const ko = {customVoiceDescription: "엔드포인트가 기대하는 음성 이름 (기본값: alloy)",modelLabel: "TTS 모델",modelDescription:- "모델 선택기에서 오디오 모델을 로드하세요(예: Orpheus TTS)",+ "오디오에서 음성 모델을 로드하세요. 채팅 모델을 대체합니다.",openAudioAction: "오디오 열기",voiceLabel: "음성",voiceDescription: "기기에서 사용 가능한 최적의 음성",+ studioVoiceDescription: "오디오에 저장된 음성은 복제 모델이 필요합니다",+ studioVoiceDefault: "모델 자체 음성",+ studioVoiceSaved: "저장된 음성",speedLabel: "속도",pitchLabel: "음높이",volumeLabel: "볼륨",diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex 4eb1aaa1b99..5a93e96e91e 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -1419,8 +1419,7 @@ export const ptBR = {buttonDescription: "Exibe o botão nas respostas do assistente",engineLabel: "Mecanismo de TTS",engineSystemDescription: "Vozes nativas do dispositivo",- engineStudioDescription:- "Usa o modelo de áudio carregado (por exemplo, Orpheus)",+ engineStudioDescription: "Usa o modelo de fala carregado em Áudio",engineSystem: "Vozes do sistema",engineStudio: "Carregar modelo de TTS",engineCustom: "Endpoint personalizado",@@ -1435,10 +1434,14 @@ export const ptBR = {"Nome da voz esperado pelo endpoint; o padrão é alloy",modelLabel: "Modelo de TTS",modelDescription:- "Carregue um modelo de áudio pelo seletor de modelos (por exemplo, Orpheus TTS)",+ "Carregue um modelo de fala em Áudio. Ele substitui o modelo do chat.",openAudioAction: "Abrir Áudio",voiceLabel: "Voz",voiceDescription: "As melhores vozes deste dispositivo",+ studioVoiceDescription:+ "Vozes salvas em Áudio exigem um modelo de clonagem",+ studioVoiceDefault: "Voz própria do modelo",+ studioVoiceSaved: "Voz salva",speedLabel: "Velocidade",pitchLabel: "Tom",volumeLabel: "Volume",diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex 4aae6ba435a..ff799ff289b 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -1417,8 +1417,7 @@ export const ru = {buttonDescription: "Показывать в ответах ассистента",engineLabel: "Движок TTS",engineSystemDescription: "Встроенные голоса устройства",- engineStudioDescription:- "Использует загруженную аудиомодель (например, Orpheus)",+ engineStudioDescription: "Использует модель речи, загруженную в Аудио",engineSystem: "Системные голоса",engineStudio: "Загрузить модель TTS",engineCustom: "Пользовательский эндпоинт",@@ -1433,10 +1432,14 @@ export const ru = {"Имя голоса, которое ожидает эндпоинт; по умолчанию alloy",modelLabel: "Модель TTS",modelDescription:- "Загрузите аудиомодель из списка моделей (например, Orpheus TTS)",+ "Загрузите модель речи в Аудио. Она заменит модель чата.",openAudioAction: "Открыть Аудио",voiceLabel: "Голос",voiceDescription: "Лучшие голоса на этом устройстве",+ studioVoiceDescription:+ "Для голосов, сохранённых в Аудио, нужна модель клонирования",+ studioVoiceDefault: "Собственный голос модели",+ studioVoiceSaved: "Сохранённый голос",speedLabel: "Скорость",pitchLabel: "Высота тона",volumeLabel: "Громкость",diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.tsindex 5cb937dbda2..2d917970da9 100644--- a/studio/frontend/src/i18n/locales/sv.ts+++ b/studio/frontend/src/i18n/locales/sv.ts@@ -1550,7 +1550,7 @@ export const sv = {engineLabel: "TTS-motor",engineSystemDescription: "Inbyggda enhetsröster",engineStudioDescription:- "Använder den inlästa ljudmodellen (t.ex. Orpheus)",+ "Använder talmodellen som är inläst i Ljud",engineSystem: "Systemröster",engineStudio: "Läs in TTS-modell",engineCustom: "Anpassad slutpunkt",@@ -1565,10 +1565,13 @@ export const sv = {"Röstnamnet som slutpunkten förväntar sig; alloy är standard",modelLabel: "TTS-modell",modelDescription:- "Läs in en ljudmodell från modellväljaren (t.ex. Orpheus TTS)",+ "Läs in en talmodell i Ljud. Den ersätter chattmodellen.",openAudioAction: "Öppna Ljud",voiceLabel: "Röst",voiceDescription: "Bästa rösterna på denna enhet",+ studioVoiceDescription: "Röster som sparats i Ljud kräver en kloningsmodell",+ studioVoiceDefault: "Modellens egen röst",+ studioVoiceSaved: "Sparad röst",speedLabel: "Hastighet",pitchLabel: "Tonhöjd",volumeLabel: "Volym",diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex 4ecb993745c..e35a014a4d4 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -1405,7 +1405,7 @@ export const zhCN = {buttonDescription: "在助手回复上显示",engineLabel: "TTS 引擎",engineSystemDescription: "设备内置语音",- engineStudioDescription: "使用已加载的音频模型(例如 Orpheus)",+ engineStudioDescription: "使用在音频中加载的语音模型",engineSystem: "系统语音",engineStudio: "加载 TTS 模型",engineCustom: "自定义端点",@@ -1417,10 +1417,13 @@ export const zhCN = {customModelLabel: "模型",customVoiceDescription: "端点所需的语音名称(默认为 alloy)",modelLabel: "TTS 模型",- modelDescription: "从模型选择器加载音频模型(例如 Orpheus TTS)",+ modelDescription: "在音频中加载语音模型。它会替换聊天模型。",openAudioAction: "打开音频",voiceLabel: "音色",voiceDescription: "此设备上效果最好的音色",+ studioVoiceDescription: "音频中保存的音色需要克隆模型",+ studioVoiceDefault: "模型自带音色",+ studioVoiceSaved: "已保存的音色",speedLabel: "语速",pitchLabel: "音调",volumeLabel: "音量",diff --git a/studio/frontend/tests/read-aloud-studio-voice.test.ts b/studio/frontend/tests/read-aloud-studio-voice.test.tsnew file mode 100644index 00000000000..59ca2e6815e--- /dev/null+++ b/studio/frontend/tests/read-aloud-studio-voice.test.ts@@ -0,0 +1,175 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Read aloud on the "Load TTS model" engine speaks in a saved Audio voice and keeps its clips+// out of Speak's history.++import assert from "node:assert/strict";+import { readdirSync } from "node:fs";+import test from "node:test";++import { loadWithStubs } from "./helpers/module-stubs.ts";++import { readSrc } from "./helpers/kit.ts";++type Adapter = {+ generateStudioTtsAudio: (+ text: string,+ signal?: AbortSignal,+ ) => Promise<string>;+};++type Reply = { status: number; body: unknown };++/** The adapter with the voice setting faked and a fetch that logs each body. */+function load(+ voiceId: string,+ reply: Reply = { status: 200, body: { audio: { data: "UklGRg==" } } },+) {+ const posted: Record<string, unknown>[] = [];+ const setVoiceIds: string[] = [];+ const adapter = loadWithStubs<Adapter>(+ new URL(+ "../src/features/chat/adapters/studio-speech-synthesis-adapter.ts",+ import.meta.url,+ ),+ {+ "@/features/auth": {+ authFetch: async (_input: string, init: { body: string }) => {+ posted.push(JSON.parse(init.body));+ return {+ ok: reply.status < 400,+ status: reply.status,+ json: async () => reply.body,+ };+ },+ },+ "../search-images/search-images": {+ stripSearchImageTokens: (text: string) => text,+ },+ "../stores/external-providers-store": {+ useExternalProvidersStore: { getState: () => ({}) },+ },+ "../api/providers-api": { encryptProviderApiKey: async () => "" },+ "../external-providers": { getExternalProviderApiKey: () => "" },+ "@/features/settings/stores/voice-settings-store": {+ useVoiceSettingsStore: {+ getState: () => ({+ ttsStudioVoiceId: voiceId,+ setTtsStudioVoiceId: (value: string) => setVoiceIds.push(value),+ }),+ },+ },+ "@/lib/toast": { toast: { error: () => {} } },+ },+ );+ return { adapter, posted, setVoiceIds };+}++test("read aloud keeps its clip out of history and speaks in the model's voice by default", async () => {+ const { adapter, posted } = load("");+ assert.equal(+ await adapter.generateStudioTtsAudio("hello"),+ "data:audio/wav;base64,UklGRg==",+ );+ assert.deepEqual(posted, [+ {+ messages: [{ role: "user", content: "hello" }],+ stream: false,+ persist: false,+ },+ ]);+});++test("read aloud sends the saved voice chosen in Settings", async () => {+ const { adapter, posted } = load("8f2c");+ await adapter.generateStudioTtsAudio("hello");+ assert.equal(posted[0].voice_id, "8f2c");+ assert.equal(posted[0].persist, false);+});++test("a deleted saved voice goes back to the model's own voice", async () => {+ const { adapter, setVoiceIds } = load("8f2c", {+ status: 404,+ body: { detail: "That saved voice no longer exists." },+ });+ await assert.rejects(+ adapter.generateStudioTtsAudio("hello"),+ /no longer exists.*model's own voice/,+ );+ assert.deepEqual(setVoiceIds, [""]);+});++test("a 404 that is not about the voice keeps the choice", async () => {+ const { adapter, setVoiceIds } = load("8f2c", {+ status: 404,+ body: { detail: "Model not found" },+ });+ await assert.rejects(+ adapter.generateStudioTtsAudio("hello"),+ /Model not found/,+ );+ assert.deepEqual(setVoiceIds, []);+});++test("a model that cannot clone says how to fix it, and keeps the choice", async () => {+ const { adapter, setVoiceIds } = load("8f2c", {+ status: 400,+ body: { detail: "Load a model that can clone a voice." },+ });+ await assert.rejects(+ adapter.generateStudioTtsAudio("hello"),+ /can't use saved voices.*Settings → Voice/,+ );+ assert.deepEqual(setVoiceIds, []);+});++test("no model loaded points at Audio instead of a model name", async () => {+ const { adapter } = load("", {+ status: 400,+ body: { detail: "No model loaded." },+ });+ await assert.rejects(+ adapter.generateStudioTtsAudio("hello"),+ /^Error: No speech model is loaded\. Open Audio/,+ );+});++test("the voice setting persists and Settings lists saved voices for the studio engine", () => {+ const store = readSrc("features/settings/stores/voice-settings-store.ts");+ assert.match(+ store,+ /ttsStudioVoiceId: asString\(saved\?\.ttsStudioVoiceId, ""\),/,+ );+ const tab = readSrc("features/settings/tabs/voice-tab.tsx");+ assert.match(+ tab,+ /if \(effectiveTtsEngine === "studio"\) \{\s*void useAudioVoicesStore\.getState\(\)\.refresh\(\);/,+ );+ // A voice deleted on the Audio page is cleared once the list is known.+ assert.match(+ tab,+ /if \(ttsStudioVoiceId && savedVoicesListed && !hasSelectedStudioVoice\) \{\s*setTtsStudioVoiceId\(""\);/,+ );+ assert.match(+ tab,+ /setTtsStudioVoiceId\(value === "model" \? "" : value\)[\s\S]*?studioVoiceDefault[\s\S]*?savedVoices\.map\(/,+ );+ // The stored choice stays visible while the list is loading or failed to load.+ assert.match(tab, /value=\{ttsStudioVoiceId \|\| "model"\}/);+ assert.match(+ tab,+ /\{ttsStudioVoiceId && !hasSelectedStudioVoice \? \(\s*<SelectItem value=\{ttsStudioVoiceId\}>\s*\{t\("settings\.voice\.readAloud\.studioVoiceSaved"\)\}/,+ );+});++test("no read-aloud copy names a model the user may not have", () => {+ const dir = new URL("../src/i18n/locales/", import.meta.url);+ for (const file of readdirSync(dir)) {+ assert.doesNotMatch(readSrc(`i18n/locales/${file}`), /Orpheus/, file);+ }+ assert.doesNotMatch(+ readSrc("features/chat/adapters/studio-speech-synthesis-adapter.ts"),+ /Orpheus/,+ );+});diff --git a/tests/studio/test_voice_settings_select_width.py b/tests/studio/test_voice_settings_select_width.pyindex 6a305e7f029..3f93a548165 100644--- a/tests/studio/test_voice_settings_select_width.py+++ b/tests/studio/test_voice_settings_select_width.py@@ -10,7 +10,7 @@ SELECT = REPO / "studio/frontend/src/components/ui/select.tsx"def test_voice_selects_grow_without_overflowing_the_dialog():source = VOICE_TAB.read_text(encoding = "utf-8")- assert source.count('className="min-w-56 max-w-72"') == 5+ assert source.count('className="min-w-56 max-w-72"') == 6select_source = SELECT.read_text(encoding = "utf-8")assert "*:data-[slot=select-value]:line-clamp-1" in select_source