{"record":{"id":"de7b2f6eb450f289","repo":"unslothai/unsloth","slug":"audio-unsupported-backend","errorCode":"audio_unsupported_backend","errorMessage":"This backend cannot generate audio.","messagePattern":"This backend cannot generate audio\\.","errorType":"exception","errorClass":"AudioBackendUnsupportedError","httpStatus":501,"severity":"warning","filePath":"studio/backend/core/inference/orchestrator.py","lineNumber":2226,"sourceCode":"                            self._mark_worker_started(cancel_event)\n                            worker_started = True\n                            continue\n\n                        if rtype == \"audio_done\":\n                            if cancel_event is not None and cancel_event.is_set():\n                                raise AudioGenerationCancelledError(\"Audio generation cancelled\")\n                            wav_bytes = base64.b64decode(resp[\"wav_base64\"])\n                            sample_rate = resp[\"sample_rate\"]\n                            return wav_bytes, sample_rate\n\n                        if rtype == \"audio_error\":\n                            if resp.get(\"cancelled\") or (\n                                cancel_event is not None and cancel_event.is_set()\n                            ):\n                                raise AudioGenerationCancelledError(\"Audio generation cancelled\")\n                            # Tagged code = no path for this task, not a failure.\n                            if resp.get(\"code\") == AUDIO_UNSUPPORTED_CODE:\n                                raise AudioBackendUnsupportedError(\n                                    resp.get(\"error\", \"This backend cannot generate audio.\"),\n                                    hint = resp.get(\"hint\"),\n                                )\n                            raise RuntimeError(resp.get(\"error\", \"Audio generation failed\"))\n\n                        if rtype == \"error\":\n                            if cancel_event is not None and cancel_event.is_set():\n                                raise AudioGenerationCancelledError(\"Audio generation cancelled\")\n                            raise RuntimeError(resp.get(\"error\", \"Unknown error\"))\n\n                        if rtype == \"status\":\n                            continue\n\n                    # A caller cancellation already spent the drain window polling this\n                    # request's mailbox. Tear down an unresponsive worker now instead of\n                    # waiting out the much longer generation watchdog or draining twice.\n                    if cancel_deadline is not None:\n                        if self._shutdown_subprocess(timeout = _AUDIO_CANCEL_DRAIN_TIMEOUT):","sourceCodeStart":2208,"sourceCodeEnd":2244,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/orchestrator.py#L2208-L2244","documentation":"AudioBackendUnsupportedError with code 'audio_unsupported_backend': the active model's inference backend has no code path for this TTS task. The source comment is explicit — a tagged code means 'no path for this task, not a failure'; the error may carry a worker-provided hint about what backend would work.","triggerScenarios":"Calling generate_audio on a model loaded with a text-only backend (e.g. a plain transformers LLM without TTS support), or requesting an audio modality the loaded adapter/backend cannot produce.","commonSituations":"UI allows the audio button for models without TTS support; user loads a chat model and triggers speech generation; backend matrix mismatch after a model switch.","solutions":["Load a TTS-capable model/backend before requesting audio.","Read the hint field — it names the supported backend or model shape.","Disable the audio action in the UI for non-TTS models (use this error's code to detect the condition)."],"exampleFix":"// before\nwav, sr = orchestrator.generate_audio(text)\n// after\nfrom core.inference.orchestrator import AudioBackendUnsupportedError\ntry:\n    wav, sr = orchestrator.generate_audio(text)\nexcept AudioBackendUnsupportedError as e:\n    show_info(e.hint or \"This model cannot generate audio\")","handlingStrategy":"type-guard","validationCode":"if not model_supports_tts(orchestrator.active_model_name):\n    disable_audio_button()","typeGuard":"from core.inference.orchestrator import AudioBackendUnsupportedError\n\ndef is_audio_unsupported(exc: Exception) -> bool:\n    return isinstance(exc, AudioBackendUnsupportedError) and getattr(exc, \"code\", None) == \"audio_unsupported_backend\"","tryCatchPattern":"try:\n    wav, sr = orchestrator.generate_audio(text)\nexcept AudioBackendUnsupportedError as e:\n    show_capability_message(e.hint)","preventionTips":["Track model capabilities in the UI and hide audio actions for non-TTS models.","Treat the tagged code as a capability signal, not a failure."],"tags":["inference","tts","unsupported","capability"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}