WhisperCpp.AbortHandle (whisper_cpp v0.2.0)

Copy Markdown View Source

Cooperative cancellation handle for WhisperCpp.transcribe/3.

Mint a handle, pass it via the :abort_handle option, then signal it from another process to ask in-flight inference to return early. whisper.cpp polls the abort flag between encoder/decoder steps; the returned %Transcription{} contains whatever segments had been produced before the abort took effect.

Summary

Functions

Asks any in-flight transcribe call using this handle to stop.

Returns true once abort/1 has been called for this handle.

Mints a fresh, un-aborted handle.

Types

t()

@type t() :: %WhisperCpp.AbortHandle{ref: reference()}

Functions

abort(abort_handle)

@spec abort(t()) :: :ok

Asks any in-flight transcribe call using this handle to stop.

aborted?(abort_handle)

@spec aborted?(t()) :: boolean()

Returns true once abort/1 has been called for this handle.

new()

@spec new() :: t()

Mints a fresh, un-aborted handle.