元編程參考文件

生成設定

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—

返回

結果文字
所屬發行版
元編程(專業版)
可用的圖種類
事件 例程 狀態機狀態
宣告於
生成設定
所屬包
機器學習