{"record":{"id":"b29cb1f564af50f6","repo":"unslothai/unsloth","slug":"another-gguf-dictation-model-self-model-id","errorCode":null,"errorMessage":"Another GGUF dictation model ('{self._model_id}') is still downloading; wait for it to finish.","messagePattern":"Another GGUF dictation model \\('(.+?)'\\) is still downloading; wait for it to finish\\.","errorType":"exception","errorClass":"SttModelIdError","httpStatus":422,"severity":"warning","filePath":"studio/backend/core/inference/stt_ggml_sidecar.py","lineNumber":551,"sourceCode":"            return None\n\n    def start(\n        self,\n        model_id: str,\n        hf_token: Optional[str] = None,\n    ) -> None:\n        model_id = resolve_ggml_model_id(model_id)\n        hub_cache = _capture_stt_hub_cache()\n        with self._lock:\n            if self._thread is not None and self._thread.is_alive():\n                if self._model_id == model_id:\n                    # Joining a cancelling run would silently download nothing.\n                    if not self._cancelled:\n                        return\n                    raise SttModelIdError(\n                        f\"'{model_id}' is still cancelling; try again in a moment.\"\n                    )\n                raise SttModelIdError(\n                    f\"Another GGUF dictation model ('{self._model_id}') is still \"\n                    \"downloading; wait for it to finish.\"\n                )\n            self._model_id = model_id\n            self._error = None\n            self._total_bytes = None\n            self._etag = None\n            self._revision = None\n            self._hub_cache = hub_cache\n            self._cancelled = False\n            self._process = None\n            thread = threading.Thread(\n                target = self._run,\n                args = (model_id, hf_token),\n                daemon = True,\n            )\n            self._thread = thread\n            thread.start()","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/unslothai/unsloth/blob/203007d19051dcd2ae33876786d117c99f6b0368/studio/backend/core/inference/stt_ggml_sidecar.py#L533-L569","documentation":"Raised by the downloader's ensure() when a download thread is alive for a DIFFERENT model id. The downloader is single-model by design: starting a second concurrent download would clobber shared state (_model_id, progress, cancel flag). The lock makes the check atomic, and the error names the model still in flight so the caller can wait or cancel it first.","triggerScenarios":"Calling ensure('model-b') while ensure('model-a') is still downloading in its background thread — e.g. a user switching dictation models rapidly in the UI.","commonSituations":"Quick model switching in a settings panel; parallel requests from multiple clients hitting the same downloader instance.","solutions":["Wait for the in-flight download to finish (poll progress/alive status) before requesting the new model.","Cancel the current download first, wait for its cancellation to settle, then ensure the new model.","Serialize model-switch requests client-side so ensure() is never called concurrently."],"exampleFix":"# before\ndownloader.ensure(model_b)  # while model_a still downloading\n# after\nwhile downloader.is_downloading():\n    time.sleep(0.5)\ndownloader.ensure(model_b)","handlingStrategy":"validation","validationCode":"while downloader.is_downloading():\n    time.sleep(0.5)  # or offer to cancel the current model first","typeGuard":"def downloader_idle(downloader) -> bool:\n    t = downloader._thread\n    return t is None or not t.is_alive()","tryCatchPattern":"try:\n    downloader.ensure(model_id)\nexcept SttModelIdError as e:\n    if \"still downloading\" in str(e):\n        wait_or_cancel_current_then_retry(model_id)\n    raise","preventionTips":["Serialize model-switch requests through a single queue.","Disable the model picker while a download is in flight, or offer cancel-then-switch.","Show download progress so users understand why switching is blocked."],"tags":["stt","whisper","ggml","download","concurrency"],"backgroundTag":null,"analyzedSha":"203007d19051dcd2ae33876786d117c99f6b0368","analyzedAt":"2026-08-15T02:48:39.846Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}