unslothai/unsloth · info · SttTranscriptionCancelledError

Transcription cancelled.

Error message

Transcription cancelled.

What it means

SttTranscriptionCancelledError raised at the top of GgmlSttSidecar.load(): the caller-supplied request_cancel_event is already set, so the load is aborted before any work. This is the first of three cancellation checkpoints in load() (before the lock, after acquiring the lock, and inside the load sequence).

Source

Thrown at studio/backend/core/inference/stt_ggml_sidecar.py:953

        return s, s.getsockname()[1]

    def _ensure_model_downloaded(self, model_id: str) -> str:
        path = _cached_model_path(model_id)
        if path is None:
            raise SttModelNotDownloadedError(
                f"STT model '{model_id}' (GGUF) is not downloaded. "
                "Download it in Settings, then Voice, before loading it."
            )
        return path

    def load(
        self,
        model: Optional[str] = None,
        request_cancel_event: Optional[threading.Event] = None,
    ) -> None:
        """Start (or switch) whisper-server for the requested curated model."""
        if request_cancel_event is not None and request_cancel_event.is_set():
            raise SttTranscriptionCancelledError("Transcription cancelled.")
        self._raise_if_update_in_progress()
        model_id = resolve_ggml_model_id(model)
        with self._lock:
            if request_cancel_event is not None and request_cancel_event.is_set():
                raise SttTranscriptionCancelledError("Transcription cancelled.")
            self._raise_if_update_in_progress()
            binary = ensure_engine_available()
            if self._process_alive() and self._model_id == model_id:
                self._schedule_idle_unload_locked()
                return
            model_path = self._ensure_model_downloaded(model_id)
            reservation, port = self._reserve_free_port()
            command = [binary, "-m", model_path, "--host", "127.0.0.1", "--port", str(port)]
            marker = _whisper_install_marker(binary)
            if _training_active():
                # Keep whisper.cpp off the accelerator during training (like the
                # Transformers sidecar's CPU choice) so a mid-training dictation
                # cannot reclaim the VRAM training just freed.

View on GitHub (pinned to 203007d190)

Solutions

  1. Treat as a normal cancellation: swallow it in the dictation pipeline and do not show an error to the user.
  2. Clear or create a fresh threading.Event before requesting a new load if the stale event is being reused.
  3. If loads are cancelled unexpectedly, check what sets request_cancel_event (training start, unload, user cancel).
Defensive patterns

Strategy: try-catch

Validate before calling

if request_cancel_event is not None and request_cancel_event.is_set():
    return  # nothing to do

Try / catch

try:
    sidecar.load(model_id, request_cancel_event=ev)
except SttTranscriptionCancelledError:
    pass  # user already cancelled; not an error

Prevention

When it happens

Trigger: Calling sidecar.load(model, request_cancel_event=ev) with ev already set — typically the user released the dictation key or cancelled while a load was queued behind the sidecar lock.

Common situations: Push-to-talk released during model switch; a training session signals cancellation of pending dictation loads; a UI cancel button races a slow cold load.

Related errors


AI-assisted analysis of unslothai/unsloth@203007d190 (2026-08-15). Data as JSON: /api/errors/96506d03be700588. Report an issue: GitHub.