mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-03 20:57:43 +01:00
Delayed tokenizers initialization
This commit is contained in:
parent
3edc456fe7
commit
c2ba3a773a
@ -180,7 +180,7 @@ import {
|
|||||||
formatInstructModeSystemPrompt,
|
formatInstructModeSystemPrompt,
|
||||||
} from "./scripts/instruct-mode.js";
|
} from "./scripts/instruct-mode.js";
|
||||||
import { applyLocale } from "./scripts/i18n.js";
|
import { applyLocale } from "./scripts/i18n.js";
|
||||||
import { getTokenCount, getTokenizerModel, saveTokenCache } from "./scripts/tokenizers.js";
|
import { getTokenCount, getTokenizerModel, initTokenizers, saveTokenCache } from "./scripts/tokenizers.js";
|
||||||
import { initPersonas, selectCurrentPersona, setPersonaDescription } from "./scripts/personas.js";
|
import { initPersonas, selectCurrentPersona, setPersonaDescription } from "./scripts/personas.js";
|
||||||
import { getBackgrounds, initBackgrounds } from "./scripts/backgrounds.js";
|
import { getBackgrounds, initBackgrounds } from "./scripts/backgrounds.js";
|
||||||
|
|
||||||
@ -719,6 +719,7 @@ async function firstLoadInit() {
|
|||||||
await getUserAvatars();
|
await getUserAvatars();
|
||||||
await getCharacters();
|
await getCharacters();
|
||||||
await getBackgrounds();
|
await getBackgrounds();
|
||||||
|
await initTokenizers();
|
||||||
initBackgrounds();
|
initBackgrounds();
|
||||||
initAuthorsNote();
|
initAuthorsNote();
|
||||||
initPersonas();
|
initPersonas();
|
||||||
|
@ -439,7 +439,7 @@ export function decodeTextTokens(tokenizerType, ids) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jQuery(async () => {
|
export async function initTokenizers() {
|
||||||
await loadTokenCache();
|
await loadTokenCache();
|
||||||
registerDebugFunction('resetTokenCache', 'Reset token cache', 'Purges the calculated token counts. Use this if you want to force a full re-tokenization of all chats or suspect the token counts are wrong.', resetTokenCache);
|
registerDebugFunction('resetTokenCache', 'Reset token cache', 'Purges the calculated token counts. Use this if you want to force a full re-tokenization of all chats or suspect the token counts are wrong.', resetTokenCache);
|
||||||
});
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user