{"record":{"id":"10d1ae9dc8c06bfb","repo":"unslothai/unsloth","slug":"model-load-did-not-reach-ready-within-timeout-s-s","errorCode":null,"errorMessage":"model load did not reach ready within {timeout_s}s","messagePattern":"model load did not reach ready within (.+?)s","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"warning","filePath":"scripts/diffusion_bench.py","lineNumber":174,"sourceCode":"\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\n\ndef _run(args: argparse.Namespace) -> dict[str, Any]:","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/scripts/diffusion_bench.py#L156-L192","documentation":"Thrown by AudioAttachmentAdapter.add (audio-attachment-adapter.ts:61-65) via getAudioSizeError (audio-utils.ts:10-14) when the picked file's byte size exceeds MAX_AUDIO_SIZE = 25MB (kept in sync with the backend limit STT_AUDIO_RAW_MAX_BYTES). It fires at attach time with a toast, before any upload.","triggerScenarios":"Selecting any audio file with file.size > 26214400 bytes — e.g. a 40MB WAV (uncompressed WAV reaches 25MB in ~2.5 minutes at 16-bit 44.1kHz stereo), long FLAC recordings, or a mislabeled video file accepted by the extension-based accept list.","commonSituations":"Long voice memos recorded as WAV/FLAC; users re-attaching podcasts; lossless rips of interviews. The size check is client-side, so it only triggers in the picker, not on programmatic sends.","solutions":["Compress or trim the audio to under 25MB (convert WAV to MP3/OGG at a modest bitrate, or cut the clip).","Split long recordings into multiple messages — but note only one audio file is allowed per message, so split across messages.","As a developer integrating programmatically, check getAudioSizeError(file.size) before calling add() to give a cleaner error."],"exampleFix":"// before: attach raw WAV\nadapter.add({ file });\n\n// after: pre-validate and down-encode\nif (getAudioSizeError(file.size)) {\n  file = await reencodeAudio(file, { format: 'audio/mpeg', bitrate: 64000 });\n}","handlingStrategy":"validation","validationCode":"import { getAudioSizeError, MAX_AUDIO_SIZE } from '@/lib/audio-utils';\n\nfunction audioSizeOk(file: File): boolean {\n  return getAudioSizeError(file.size) === null; // file.size <= MAX_AUDIO_SIZE (25MB)\n}","typeGuard":null,"tryCatchPattern":"if (!audioSizeOk(file)) {\n  toast.error(`Compress the audio below ${MAX_AUDIO_SIZE_LABEL} before attaching.`);\n} else {\n  await adapter.add({ file });\n}","preventionTips":["Show file size in the picker UI and block oversize files before add() runs.","Prefer compressed formats (MP3/OGG) over raw WAV for long recordings.","Keep the client constant in sync with the backend STT_AUDIO_RAW_MAX_BYTES when forking either side."],"tags":["audio","file-size","validation","attachments","frontend"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}