WhisperCt2.Model (whisper_ct2 v0.5.0)

Copy Markdown View Source

Loaded Whisper model handle.

Holds an opaque NIF reference plus cached metadata (:sampling_rate, :n_samples, :multilingual). The reference is garbage-collected by the BEAM when no longer reachable; CTranslate2 frees the model at that point.

Summary

Types

compute_type()

@type compute_type() ::
  :default
  | :auto
  | :float32
  | :float16
  | :bfloat16
  | :int8
  | :int8_float32
  | :int8_float16
  | :int8_bfloat16
  | :int16

device()

@type device() :: :cpu | :cuda

t()

@type t() :: %WhisperCt2.Model{
  compute_type: compute_type(),
  device: device(),
  multilingual: boolean(),
  n_samples: pos_integer(),
  path: Path.t(),
  ref: reference(),
  sampling_rate: pos_integer()
}