Divooka Reference

Generation Settings

10 nodes

On this page 10

Make Generation Settings

Function

Settings for generating text.

Signature
GenerationSettings -> Generation Settings
    maxNewTokens: Integer
    sample: Truth
    temperature: Number
    topP: Number
    topK: Integer
    repetitionPenalty: Number
    seed: Integer
    stopAt: Text Array
GenerationSettings GenerationSettings(
    int maxNewTokens = 256,
    bool sample = false,
    double temperature = 0.7,
    double topP = 0.9,
    int topK = 50,
    double repetitionPenalty = 1,
    int seed = 0,
    string[] stopAt)

Parameters

nametypedefaultdescription
maxNewTokensInteger256The most tokens the reply may have; a token is about three quarters of an English word.
sampleTruthFalseSample among likely words rather than always taking the likeliest; off gives the same reply every run.
temperatureNumber0.7When sampling, how adventurous the choice is: below 1 safer, above 1 wilder.
topPNumber0.9When sampling, choose only among the likeliest words whose chances add up to this.
topKInteger50When sampling, choose only among this many likeliest words; 0 for no limit.
repetitionPenaltyNumber1Above 1 discourages repeating what was already said.
seedInteger0When sampling, the seed that makes a run repeatable; the same seed and settings give the same reply on the same device.
stopAtText Array—Texts that end the reply as soon as they are written, such as a closing tag.

Returns

resultGeneration Settings
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Max New Tokens

Function

The most tokens a reply may have.

Signature
MaxNewTokens(Generation Settings: Generation Settings) -> Integer
int MaxNewTokens(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Repetition Penalty

Function

How much repeating is discouraged.

Signature
RepetitionPenalty(Generation Settings: Generation Settings) -> Number
double RepetitionPenalty(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Sample

Function

Whether words are sampled rather than always the likeliest.

Signature
Sample(Generation Settings: Generation Settings) -> Truth
bool Sample(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultTruth
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Seed

Function

The seed sampling starts from.

Signature
Seed(Generation Settings: Generation Settings) -> Integer
int Seed(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Stop At

Function

Texts that end the reply.

Signature
StopAt(Generation Settings: Generation Settings) -> Text Array
string[] StopAt(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultText Array
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Temperature

Function

How adventurous sampling is.

Signature
Temperature(Generation Settings: Generation Settings) -> Number
double Temperature(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Top K

Function

How many of the likeliest words sampling chooses among.

Signature
TopK(Generation Settings: Generation Settings) -> Integer
int TopK(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultInteger
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

Top P

Function

The share of probability sampling chooses within.

Signature
TopP(Generation Settings: Generation Settings) -> Number
double TopP(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultNumber
Ships with
Divooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Generation Settings
Package
Machine Learning

To String

Function

One line, as a preview shows it.

Signature
ToString(Generation Settings: Generation Settings) -> Text
string ToString(GenerationSettings Generation Settings)

Parameters

nametypedefaultdescription
Generation SettingsGeneration Settings—

Returns

resultText
Ships with
Divooka Compute
Graph kinds
Events Routine StateMachineState
Declared by
Generation Settings
Package
Machine Learning