Generation Settings
10 nodes
On this page 10
Make Generation Settings
FunctionSettings for generating text.
Signature
GenerationSettings -> Generation Settings
maxNewTokens: Integer
sample: Truth
temperature: Number
topP: Number
topK: Integer
repetitionPenalty: Number
seed: Integer
stopAt: Text ArrayGenerationSettings 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
| name | type | default | description |
|---|---|---|---|
| maxNewTokens | Integer | 256 | The most tokens the reply may have; a token is about three quarters of an English word. |
| sample | Truth | False | Sample among likely words rather than always taking the likeliest; off gives the same reply every run. |
| temperature | Number | 0.7 | When sampling, how adventurous the choice is: below 1 safer, above 1 wilder. |
| topP | Number | 0.9 | When sampling, choose only among the likeliest words whose chances add up to this. |
| topK | Integer | 50 | When sampling, choose only among this many likeliest words; 0 for no limit. |
| repetitionPenalty | Number | 1 | Above 1 discourages repeating what was already said. |
| seed | Integer | 0 | When sampling, the seed that makes a run repeatable; the same seed and settings give the same reply on the same device. |
| stopAt | Text Array | — | Texts that end the reply as soon as they are written, such as a closing tag. |
Returns
| result | Generation Settings |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Max New Tokens
FunctionThe most tokens a reply may have.
Signature
MaxNewTokens(Generation Settings: Generation Settings) -> Integer
int MaxNewTokens(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Integer |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Repetition Penalty
FunctionHow much repeating is discouraged.
Signature
RepetitionPenalty(Generation Settings: Generation Settings) -> Number
double RepetitionPenalty(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Number |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Sample
FunctionWhether words are sampled rather than always the likeliest.
Signature
Sample(Generation Settings: Generation Settings) -> Truth
bool Sample(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Truth |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Seed
FunctionThe seed sampling starts from.
Signature
Seed(Generation Settings: Generation Settings) -> Integer
int Seed(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Integer |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Stop At
FunctionTexts that end the reply.
Signature
StopAt(Generation Settings: Generation Settings) -> Text Array
string[] StopAt(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Text Array |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Temperature
FunctionHow adventurous sampling is.
Signature
Temperature(Generation Settings: Generation Settings) -> Number
double Temperature(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Number |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Top K
FunctionHow many of the likeliest words sampling chooses among.
Signature
TopK(Generation Settings: Generation Settings) -> Integer
int TopK(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Integer |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
Top P
FunctionThe share of probability sampling chooses within.
Signature
TopP(Generation Settings: Generation Settings) -> Number
double TopP(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Number |
- Ships with
- Divooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning
To String
FunctionOne line, as a preview shows it.
Signature
ToString(Generation Settings: Generation Settings) -> Text
string ToString(GenerationSettings Generation Settings)
Parameters
| name | type | default | description |
|---|---|---|---|
| Generation Settings | Generation Settings | — |
Returns
| result | Text |
- Ships with
- Divooka Compute
- Graph kinds
- Events Routine StateMachineState
- Declared by
- Generation Settings
- Package
- Machine Learning