{"record":{"id":"6c5cad7bdb2ea0a4","repo":"unslothai/unsloth","slug":"load-error-p-get-error","errorCode":null,"errorMessage":"load error: {p.get('error')}","messagePattern":"load error: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"warning","filePath":"scripts/diffusion_bench.py","lineNumber":172,"sourceCode":"\n# ── load + generate ────────────────────────────────────────────────────────\n\n\ndef _wait_for_load(backend: Any, timeout_s: int = 2400) -> None:\n    deadline = time.time() + timeout_s\n    last = None\n    while time.time() < deadline:\n        p = backend.load_progress()\n        phase = p.get(\"phase\")\n        if phase != last:\n            last = phase\n            frac = p.get(\"fraction\") or 0.0\n            bt = (p.get(\"bytes_total\") or 0) / 1e9\n            print(f\"  load phase={phase} frac={frac:.3f} total={bt:.2f}GB\", flush = True)\n        if phase == \"ready\":\n            return\n        if phase == \"error\":\n            raise RuntimeError(f\"load error: {p.get('error')}\")\n        time.sleep(2)\n    raise TimeoutError(f\"model load did not reach ready within {timeout_s}s\")\n\n\ndef _generate_once(backend: Any, args: argparse.Namespace) -> Any:\n    \"\"\"One generation at the fixed seed; returns the first PIL image.\"\"\"\n    result = backend.generate(\n        prompt = args.prompt,\n        width = args.width,\n        height = args.height,\n        steps = args.steps,\n        guidance = args.guidance,\n        seed = args.seed,\n        batch_size = args.batch_size,\n    )\n    images = result[\"images\"]\n    return images[0]\n","sourceCodeStart":154,"sourceCodeEnd":190,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/scripts/diffusion_bench.py#L154-L190","documentation":"Thrown by AudioAttachmentAdapter.add (audio-attachment-adapter.ts:47-60) when a model IS loaded and not loading, but the active model lacks hasAudioInput. The message names the offending model via its display name, externalModelLabel(checkpoint) for external:: ids (issue #8405), or the raw checkpoint string. It fires at file-pick time, mirroring the image adapter gate, and is accompanied by a toast.","triggerScenarios":"User opens the 'Add photos & files' picker and selects an audio file while the loaded checkpoint is a text/vision-only model or an external provider model whose registry entry lacks audio input capability. The check is activeModel?.hasAudioInput === undefined/false — including external models that have no row in state.models at all.","commonSituations":"Loading a small local LLM (no audio tower) and trying to attach a voice memo; switching to an OpenAI-compatible provider whose model metadata does not advertise audio; using a Whisper-typed LoRA where the base checkpoint id resolves to a non-audio row.","solutions":["Load a model that accepts audio input (e.g. an audio-capable multimodal model) before attaching audio files.","If using an external provider, pick a model known to accept audio (e.g. a provider model with an audio tier); verify its capability metadata in the models list.","Remove the audio attachment and send the message as text-only if audio is not essential.","As a developer adding provider models, ensure the model registry entry sets hasAudioInput so the gate can recognize it."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function modelAcceptsAudio(state: { params: { checkpoint: string }; models: Array<{id: string; hasAudioInput?: boolean}>; modelLoading: boolean }): boolean {\n  const m = state.models.find((x) => x.id === state.params.checkpoint);\n  return !!state.params.checkpoint && !state.modelLoading && !!m?.hasAudioInput;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await adapter.add({ file });\n} catch (error) {\n  // adapter already toasts; swallow to avoid a double toast\n  if (!(error instanceof Error && /cannot accept audio/.test(error.message))) throw error;\n}","preventionTips":["Hide or disable the audio attach affordance when the active model lacks hasAudioInput.","Check useChatRuntimeStore.getState().models for hasAudioInput before showing the audio picker entry.","Ensure external provider model metadata sets audio capabilities so the gate is accurate."],"tags":["audio","attachments","model-capabilities","frontend","validation"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}