Delayed tokenizers initialization
This commit is contained in:
parent
3edc456fe7
commit
c2ba3a773a
|
@ -180,7 +180,7 @@ import {
|
|||
formatInstructModeSystemPrompt,
|
||||
} from "./scripts/instruct-mode.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 { getBackgrounds, initBackgrounds } from "./scripts/backgrounds.js";
|
||||
|
||||
|
@ -719,6 +719,7 @@ async function firstLoadInit() {
|
|||
await getUserAvatars();
|
||||
await getCharacters();
|
||||
await getBackgrounds();
|
||||
await initTokenizers();
|
||||
initBackgrounds();
|
||||
initAuthorsNote();
|
||||
initPersonas();
|
||||
|
|
|
@ -439,7 +439,7 @@ export function decodeTextTokens(tokenizerType, ids) {
|
|||
}
|
||||
}
|
||||
|
||||
jQuery(async () => {
|
||||
export async function initTokenizers() {
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue