Documentation
¶
Overview ¶
Package sample turns a row of logits into a token.
The chain is the one llama.cpp runs by default, in its order: top-k cuts the row down to the most likely few, top-p cuts it again at a share of the mass, temperature reshapes what is left, and a draw from the resulting distribution names the token. A temperature of zero short-circuits all of it and takes the highest logit.
Nothing here knows what model produced the row.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Params ¶
type Params struct {
// Temperature divides the logits before the draw. Zero or less is greedy.
Temperature float32
// TopK keeps that many candidates. Zero or less keeps all of them.
TopK int
// TopP keeps the shortest prefix of the sorted candidates whose
// probabilities reach it. One or more keeps all of them.
TopP float32
// Seed fixes the run: the same seed over the same logits draws the same
// tokens.
Seed uint64
}
Click to show internal directories.
Click to hide internal directories.