mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add option to auto-adjust number of chroma messages to keep / query based on context size.
This commit is contained in:
@@ -558,7 +558,7 @@ function getCurrentChatId() {
|
||||
}
|
||||
}
|
||||
|
||||
const CHARACTERS_PER_TOKEN_RATIO = 3.35;
|
||||
export const CHARACTERS_PER_TOKEN_RATIO = 3.35;
|
||||
const talkativeness_default = 0.5;
|
||||
|
||||
var is_advanced_char_open = false;
|
||||
@@ -1945,8 +1945,11 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
coreChat.pop();
|
||||
}
|
||||
|
||||
// Determine token limit
|
||||
let this_max_context = getMaxContextSize();
|
||||
|
||||
if (extension_settings.chromadb.n_results !== 0) {
|
||||
await runGenerationInterceptors(coreChat);
|
||||
await runGenerationInterceptors(coreChat, this_max_context);
|
||||
console.log(`Core/all messages: ${coreChat.length}/${chat.length}`);
|
||||
}
|
||||
|
||||
@@ -1993,9 +1996,6 @@ async function Generate(type, { automatic_trigger, force_name2, resolve, reject,
|
||||
chat2[i] = formatMessageHistoryItem(coreChat[j], isInstruct);
|
||||
}
|
||||
|
||||
// Determine token limit
|
||||
let this_max_context = getMaxContextSize();
|
||||
|
||||
// Adjust token limit for Horde
|
||||
let adjustedParams;
|
||||
if (main_api == 'koboldhorde' && (horde_settings.auto_adjust_context_length || horde_settings.auto_adjust_response_length)) {
|
||||
|
Reference in New Issue
Block a user