Fix Qwen and Command tokenizers not used for logit bias

0207794a2b1ae02f71a84dad0e496d712b559c8b

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +7 -3Ignore whitespace
public/scripts/textgen-settings.js+2 -2
@@ -15,7 +15,7 @@ import { BIAS_CACHE, createNewLogitBiasEntry, displayLogitBias, getLogitBiasList
15import { power_user, registerDebugFunction } from './power-user.js';15import { power_user, registerDebugFunction } from './power-user.js';
16import { getEventSourceStream } from './sse-stream.js';16import { getEventSourceStream } from './sse-stream.js';
17import { getCurrentDreamGenModelTokenizer, getCurrentOpenRouterModelTokenizer } from './textgen-models.js';17import { getCurrentDreamGenModelTokenizer, getCurrentOpenRouterModelTokenizer } from './textgen-models.js';
18import { SENTENCEPIECE_TOKENIZERS, TEXTGEN_TOKENIZERS, getTextTokens, tokenizers } from './tokenizers.js';18import { ENCODE_TOKENIZERS, TEXTGEN_TOKENIZERS, getTextTokens, tokenizers } from './tokenizers.js';
19import { getSortableDelay, onlyUnique } from './utils.js';19import { getSortableDelay, onlyUnique } from './utils.js';
2020
21export {21export {
@@ -353,7 +353,7 @@ function getTokenizerForTokenIds() {
353 return tokenizers.API_CURRENT;353 return tokenizers.API_CURRENT;
354 }354 }
355355
356 if (SENTENCEPIECE_TOKENIZERS.includes(power_user.tokenizer)) {356 if (ENCODE_TOKENIZERS.includes(power_user.tokenizer)) {
357 return power_user.tokenizer;357 return power_user.tokenizer;
358 }358 }
359359
public/scripts/tokenizers.js+5 -1
@@ -33,18 +33,22 @@ export const tokenizers = {
33 BEST_MATCH: 99,33 BEST_MATCH: 99,
34};34};
3535
36export const SENTENCEPIECE_TOKENIZERS = [36// A list of local tokenizers that support encoding and decoding token ids.
37export const ENCODE_TOKENIZERS = [
37 tokenizers.LLAMA,38 tokenizers.LLAMA,
38 tokenizers.MISTRAL,39 tokenizers.MISTRAL,
39 tokenizers.YI,40 tokenizers.YI,
40 tokenizers.LLAMA3,41 tokenizers.LLAMA3,
41 tokenizers.GEMMA,42 tokenizers.GEMMA,
42 tokenizers.JAMBA,43 tokenizers.JAMBA,
44 tokenizers.QWEN2,
45 tokenizers.COMMAND_R,
43 // uncomment when NovelAI releases Kayra and Clio weights, lol46 // uncomment when NovelAI releases Kayra and Clio weights, lol
44 //tokenizers.NERD,47 //tokenizers.NERD,
45 //tokenizers.NERD2,48 //tokenizers.NERD2,
46];49];
4750
51// A list of Text Completion sources that support remote tokenization.
48export const TEXTGEN_TOKENIZERS = [OOBA, TABBY, KOBOLDCPP, LLAMACPP, VLLM, APHRODITE];52export const TEXTGEN_TOKENIZERS = [OOBA, TABBY, KOBOLDCPP, LLAMACPP, VLLM, APHRODITE];
4953
50const TOKENIZER_URLS = {54const TOKENIZER_URLS = {