WhisperDecoder class

Inheritance

Constructors

WhisperDecoder({required int vocabSize, required int embedDim, required int numHeads, required int numLayers, int nCtx = 448, Device device = Device.CPU})

Properties

blocks → List<WhisperDecoderBlock>
final
device → Device
final
embedDim → int
final
hashCode → int
The hash code for this object.
no setterinherited
ln → LayerNorm
final
nCtx → int
final
numHeads → int
final
numLayers → int
final
positionalEmbedding → Tensor
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tokenEmbedding → Embedding
final
training ↔ bool
Whether this module is in training mode. Layers that behave differently between training and inference (e.g. Dropout) read this flag in their call method. Defaults to training mode.
getter/setter pairinherited
vocabSize → int
final

Methods

eval() → void
Put this module (and any registered submodules) into evaluation mode.
inherited
forward(Tensor tokens) → Tensor
Run the decoder on the full token prefix [B, T]. Returns hidden states [B, T, embedDim].
greedyDecode({required List<int> startTokens, required int eot, int maxLen = 100, List<int> initialSuppress = const []}) → List<int>
Greedy decode from startTokens up to maxLen, stopping when eot is emitted. Caller must have called primeCrossAttn first.
logitsLastToken(Tensor hidden) → Tensor
Given decoder hidden [B, T, C], project only the last position into vocab logits [B, V] using the tied token-embedding matrix.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parameters() → List<Tensor>
Trainable tensors owned by this module (and its submodules).
override
primeCrossAttn(Tensor encoderMemory) → void
submodules() → List<Module>
Submodules owned by this module. Subclasses that compose other modules should override this so train() / eval() propagate. Default: empty.
inherited
toString() → String
A string representation of this object.
inherited
train() → void
Put this module (and any registered submodules) into training mode.
inherited
zeroGrad() → void
Zero every parameter's gradient. Safe to call before each backward.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited