元编程参考文档

生成设置

10 个节点

本页内容 10

生成设置

函数

Settings for generating text.

签名
生成设置 -> Generation Settings
    最大新词元数: 整数
    采样: 真否
    温度: 数字
    Top-P: 数字
    Top-K: 整数
    重复惩罚: 数字
    种子: 整数
    停止于: 文本数组
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)

参数

名称类型默认值说明
最大新词元数整数256The most tokens the reply may have; a token is about three quarters of an English word.
采样真否FalseSample among likely words rather than always taking the likeliest; off gives the same reply every run.
温度数字0.7When sampling, how adventurous the choice is: below 1 safer, above 1 wilder.
Top-P数字0.9When sampling, choose only among the likeliest words whose chances add up to this.
Top-K整数50When sampling, choose only among this many likeliest words; 0 for no limit.
重复惩罚数字1Above 1 discourages repeating what was already said.
种子整数0When sampling, the seed that makes a run repeatable; the same seed and settings give the same reply on the same device.
停止于文本数组—Texts that end the reply as soon as they are written, such as a closing tag.

返回

生成设置Generation Settings
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

最大新词元数

函数

The most tokens a reply may have.

签名
最大新词元数(Generation Settings: Generation Settings) -> 整数
int MaxNewTokens(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果整数
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

重复惩罚

函数

How much repeating is discouraged.

签名
重复惩罚(Generation Settings: Generation Settings) -> 数字
double RepetitionPenalty(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果数字
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

采样

函数

Whether words are sampled rather than always the likeliest.

签名
采样(Generation Settings: Generation Settings) -> 真否
bool Sample(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果真否
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

种子

函数

The seed sampling starts from.

签名
种子(Generation Settings: Generation Settings) -> 整数
int Seed(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果整数
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

停止于

函数

Texts that end the reply.

签名
停止于(Generation Settings: Generation Settings) -> 文本数组
string[] StopAt(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果文本数组
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

温度

函数

How adventurous sampling is.

签名
温度(Generation Settings: Generation Settings) -> 数字
double Temperature(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果数字
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

Top-K

函数

How many of the likeliest words sampling chooses among.

签名
Top-K(Generation Settings: Generation Settings) -> 整数
int TopK(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果整数
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

Top-P

函数

The share of probability sampling chooses within.

签名
Top-P(Generation Settings: Generation Settings) -> 数字
double TopP(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果数字
所属发行版
元编程(专业版)
可用的图种类
数据流 函数 事件 例程 蓝图 状态机状态
声明于
生成设置
所属包
机器学习

转为文本

函数

One line, as a preview shows it.

签名
转为文本(Generation Settings: Generation Settings) -> 文本
string ToString(GenerationSettings Generation Settings)

参数

名称类型默认值说明
Generation SettingsGeneration Settings—

返回

结果文本
所属发行版
元编程(专业版)
可用的图种类
事件 例程 状态机状态
声明于
生成设置
所属包
机器学习