Every verb taking an array of entries also takes a packed tape, which the Node addon lends to
the call as it is when its offsets are a BigUint64Array; an array of entries is first gathered
into one tape, the one copy that path makes. A Probabilities answer is itself a tape, so it
trains a step's choiceTargets as it lands.
OffsetsThe count + 1 offsets of a tape: a BigUint64Array, which the Node addon lends as size_t without a copy, or a Uint32Array, which it widens and the WebAssembly module, whose size_t is 32 bits wide, lends as it is.
data is a Float32Array for f32, a Float16Array for f16 where the runtime has one, a
Uint16Array for bf16, and raw bytes for the kinds JavaScript spells no element for.
ClassStatesThe final-norm states or the token vectors a call landed in its arena: rows end to end, item i spanning rows offsets[i] up to offsets[i + 1].4
abstract class EncodeVerbs<Receiving extends "blocking" | "deferred">
The receiver chooses where a verb runs and how it completes, and the verb stays the same: a
Model runs it on the calling thread, model.on(executor) blocks on an executor, and
model.deferred(executor) submits it there and answers a Deferred. Every verb lands its
outputs in arena and answers views into it.
textEncodeEncodes texts through one forward; every UTF-8 byte is a token.
The surfaces, their scalar, and a progress handler.
Returns
The outputs, viewed inside arena.
textChooseScores each item's legal choices through one forward, a softmax over them alone at the item's group's calibrated inverse temperature; a model without the byte decoder reports unsupported.