Put tokenizer functions to a separate file. Cache local models token counts

This commit is contained in:
Cohee
2023-08-23 02:38:43 +03:00
parent 7250770c5d
commit bc5fc67906
11 changed files with 360 additions and 308 deletions

View File

@@ -2,15 +2,12 @@ esversion: 6
import {
Generate,
this_chid,
characters,
online_status,
main_api,
api_server,
api_server_textgenerationwebui,
is_send_press,
getTokenCount,
menu_type,
max_context,
saveSettingsDebounced,
active_group,
@@ -35,6 +32,7 @@ import {
} from "./secrets.js";
import { debounce, delay, getStringHash, waitUntilCondition } from "./utils.js";
import { chat_completion_sources, oai_settings } from "./openai.js";
import { getTokenCount } from "./tokenizers.js";
var RPanelPin = document.getElementById("rm_button_panel_pin");
var LPanelPin = document.getElementById("lm_button_panel_pin");