mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#2085 Implement async token counting
This commit is contained in:
@ -2764,6 +2764,14 @@ export function getCustomStoppingStrings(limit = undefined) {
|
||||
return strings;
|
||||
}
|
||||
|
||||
export function forceCharacterEditorTokenize() {
|
||||
$('[data-token-counter]').each(function () {
|
||||
$(document.getElementById($(this).data('token-counter'))).data('last-value-hash', '');
|
||||
});
|
||||
$('#rm_ch_create_block').trigger('input');
|
||||
$('#character_popup').trigger('input');
|
||||
}
|
||||
|
||||
$(document).ready(() => {
|
||||
const adjustAutocompleteDebounced = debounce(() => {
|
||||
$('.ui-autocomplete-input').each(function () {
|
||||
@ -3175,8 +3183,7 @@ $(document).ready(() => {
|
||||
saveSettingsDebounced();
|
||||
|
||||
// Trigger character editor re-tokenize
|
||||
$('#rm_ch_create_block').trigger('input');
|
||||
$('#character_popup').trigger('input');
|
||||
forceCharacterEditorTokenize();
|
||||
});
|
||||
|
||||
$('#send_on_enter').on('change', function () {
|
||||
|
Reference in New Issue
Block a user