tokenizer changes and fixes. + a toggle

This commit is contained in:
based
2023-12-14 16:31:08 +10:00
parent e26159c00d
commit 3e82a7d439
5 changed files with 24 additions and 7 deletions

View File

@ -393,7 +393,7 @@ export function getTokenizerModel() {
*/
export function countTokensOpenAI(messages, full = false) {
const shouldTokenizeAI21 = oai_settings.chat_completion_source === chat_completion_sources.AI21 && oai_settings.use_ai21_tokenizer;
const shouldTokenizeGoogle = oai_settings.chat_completion_source === chat_completion_sources.MAKERSUITE;
const shouldTokenizeGoogle = oai_settings.chat_completion_source === chat_completion_sources.MAKERSUITE && oai_settings.use_google_tokenizer;
let tokenizerEndpoint = '';
if(shouldTokenizeAI21) {
tokenizerEndpoint = '/api/tokenizers/ai21/count';