mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-04-17 04:07:21 +02:00
Don't reduce Claude token counts by 2
This commit is contained in:
parent
07a9e493dc
commit
7250770c5d
@ -1437,6 +1437,11 @@ function countTokens(messages, full = false) {
|
|||||||
|
|
||||||
for (const message of messages) {
|
for (const message of messages) {
|
||||||
const model = getTokenizerModel();
|
const model = getTokenizerModel();
|
||||||
|
|
||||||
|
if (model === 'claude' || shouldTokenizeAI21) {
|
||||||
|
full = true;
|
||||||
|
}
|
||||||
|
|
||||||
const hash = getStringHash(JSON.stringify(message));
|
const hash = getStringHash(JSON.stringify(message));
|
||||||
const cacheKey = `${model}-${hash}`;
|
const cacheKey = `${model}-${hash}`;
|
||||||
const cachedCount = tokenCache[chatId][cacheKey];
|
const cachedCount = tokenCache[chatId][cacheKey];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user