sampleFrame method
Three passes reveal four randomly ordered codebooks each. The penalty
covers the codes of the last repetitionWindow frames of history.
Omitted options use sampling; a null top-k there samples every code.
Random seeds are Dart-specific.
Implementation
List<int> sampleFrame(
Float32List hidden,
math.Random random, {
double? temperature,
int? topK,
double? repetitionPenalty,
int? repetitionWindow,
List<List<int>> history = const [],
}) {
return _sampleFrame(
hidden,
random,
temperature ?? sampling.temperature,
topK ?? sampling.topK ?? vocabSize,
repetitionPenalty ?? sampling.repetitionPenalty,
repetitionWindow ?? sampling.repetitionWindow,
history,
);
}