From 944f1317666dd1f02dba2bc7c1b3a97c1ad93f21 Mon Sep 17 00:00:00 2001 From: Lei Mingyu Date: Tue, 29 Oct 2024 17:31:18 +0900 Subject: [PATCH] Use maxTemperature in session creation sample code See also #53. --- README.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7f22799..d8a7d63 100644 --- a/README.md +++ b/README.md @@ -185,10 +185,14 @@ const customSession = await ai.languageModel.create({ const capabilities = await ai.languageModel.capabilities(); const slightlyHighTemperatureSession = await ai.languageModel.create({ - temperature: Math.max(capabilities.defaultTemperature * 1.2, 1.0), + temperature: Math.max( + capabilities.defaultTemperature * 1.2, + capabilities.maxTemperature + ), + topK: 10 }); -// capabilities also contains maxTemperature, defaultTopK, and maxTopK. +// capabilities also contains defaultTopK and maxTopK. ``` ### Session persistence and cloning