GPTModel class

Constructors

GPTModel(GPTConfig cfg)

Properties

blocks List<TransformerBlock>
final
cfg GPTConfig
final
hashCode int
The hash code for this object.
no setterinherited
final
lnF LayerNorm
final
posEmb Embedding
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
tokEmb Embedding
final

Methods

forward(List<int> tokens) Tensor2D
Forward pass (no sampling): returns logits (T, vocab)
generate(List<int> prompt, int maxNewTokens, Sampler sampler, {void onToken(int token, int step)?}) List<int>
Generate token ids using sampler and optional callback per step.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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