mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Clamp Claude's max temp when using Window AI
This commit is contained in:
@ -551,6 +551,14 @@ async function sendWindowAIRequest(openai_msgs_tosend, signal, stream) {
|
|||||||
let lastContent = '';
|
let lastContent = '';
|
||||||
let finished = false;
|
let finished = false;
|
||||||
|
|
||||||
|
const currentModel = await window.ai.getCurrentModel();
|
||||||
|
let temperature = parseFloat(oai_settings.temp_openai);
|
||||||
|
|
||||||
|
if (currentModel.includes('claude') && temperature > claude_max_temp) {
|
||||||
|
console.warn(`Claude model only supports temperature up to ${claude_max_temp}. Clamping ${temperature} to ${claude_max_temp}.`);
|
||||||
|
temperature = claude_max_temp;
|
||||||
|
}
|
||||||
|
|
||||||
async function* windowStreamingFunction() {
|
async function* windowStreamingFunction() {
|
||||||
while (true) {
|
while (true) {
|
||||||
if (signal.aborted) {
|
if (signal.aborted) {
|
||||||
@ -592,7 +600,7 @@ async function sendWindowAIRequest(openai_msgs_tosend, signal, stream) {
|
|||||||
messages: openai_msgs_tosend,
|
messages: openai_msgs_tosend,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
temperature: parseFloat(oai_settings.temp_openai),
|
temperature: temperature,
|
||||||
maxTokens: oai_settings.openai_max_tokens,
|
maxTokens: oai_settings.openai_max_tokens,
|
||||||
onStreamResult: onStreamResult,
|
onStreamResult: onStreamResult,
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user