mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add padding to cache key. Fix Safari display issues. Fix 400 on empty translate. Reset bias cache on changing model.
This commit is contained in:
@ -134,7 +134,7 @@ export function getTokenCount(str, padding = undefined) {
|
||||
|
||||
const cacheObject = getTokenCacheObject();
|
||||
const hash = getStringHash(str);
|
||||
const cacheKey = `${tokenizerType}-${hash}`;
|
||||
const cacheKey = `${tokenizerType}-${hash}+${padding}`;
|
||||
|
||||
if (typeof cacheObject[cacheKey] === 'number') {
|
||||
return cacheObject[cacheKey];
|
||||
|
Reference in New Issue
Block a user