{"record":{"id":"4f7b2400528990b2","repo":"unslothai/unsloth","slug":"gguf-stt-model-loading-was-cancelled-so-training-c","errorCode":null,"errorMessage":"GGUF STT model loading was cancelled so training could start.","messagePattern":"GGUF STT model loading was cancelled so training could start\\.","errorType":"exception","errorClass":"SttLoadCancelledError","httpStatus":409,"severity":"info","filePath":"studio/backend/core/inference/stt_ggml_sidecar.py","lineNumber":1041,"sourceCode":"                self._schedule_idle_unload_locked()\n            finally:\n                reservation.close()  # no-op when already released before spawn\n                with self._load_state_lock:\n                    self._loading = False\n                    self._load_cancel_event = None\n                    self._load_owner_cancel_event = None\n                    self._starting_process = None\n\n    @staticmethod\n    def _wait_for_server(\n        process: subprocess.Popen,\n        port: int,\n        cancel_event: Optional[threading.Event] = None,\n    ) -> None:\n        deadline = time.monotonic() + _SERVER_START_TIMEOUT_SECONDS\n        while time.monotonic() < deadline:\n            if cancel_event is not None and cancel_event.is_set():\n                raise SttLoadCancelledError(\n                    \"GGUF STT model loading was cancelled so training could start.\"\n                )\n            if process.poll() is not None:\n                raise SttEngineUnavailableError(\n                    \"The local transcription runtime exited before becoming \"\n                    \"ready; the model file may be corrupt or unsupported.\"\n                )\n            # Require a whisper-server-specific response twice, with the managed\n            # child alive around each probe. An arbitrary local process that won\n            # the bind race would otherwise be mistaken for the sidecar and\n            # receive the user's microphone audio.\n            if GgmlSttSidecar._probe_is_whisper_server(process, port) and (\n                GgmlSttSidecar._probe_is_whisper_server(process, port)\n            ):\n                return\n            time.sleep(0.2)\n        raise SttEngineUnavailableError(\"The local transcription runtime did not start in time.\")\n","sourceCodeStart":1023,"sourceCodeEnd":1059,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_ggml_sidecar.py#L1023-L1059","documentation":"SttLoadCancelledError raised in GgmlSttSidecar._wait_for_server: while polling for whisper-server readiness (up to _SERVER_START_TIMEOUT_SECONDS), the cancel_event is set, typically because a training run requested the GPU/engine back. The pending child spawn is abandoned instead of racing training.","triggerScenarios":"load() spawned whisper-server and is inside the readiness poll loop when cancel_event (owned by training coordination or the request) is set; the loop raises before the server ever answers.","commonSituations":"User starts a fine-tune while a dictation model is cold-loading; slow model load from disk on first use overlaps with a queued training job; GPU-constrained machines where loads take tens of seconds.","solutions":["Retry the dictation after training completes — the load was cancelled intentionally, not failed.","Pre-warm the GGML model (call load() without a cancel event) before starting training so dictation works mid-training on CPU/queued.","Do not treat this as engine breakage; it must not call note_runtime_inference_failure or disable the GGML engine."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try:\n    sidecar.load(model_id)\nexcept SttLoadCancelledError:\n    # training claimed the engine; retry when it completes\n    enqueue_retry(after_training_done)","preventionTips":["Pre-warm dictation models before starting training runs.","Treat SttLoadCancelledError as coordination, not breakage — never disable the engine on it.","Keep cold loads short (small model, warm page cache) to shrink the cancellation window."],"tags":["stt","ggml","cancellation","training","startup-race"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}