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
1515import { power_user, registerDebugFunction } from './power-user.js';
1616import { getEventSourceStream } from './sse-stream.js';
1717import { getCurrentDreamGenModelTokenizer, getCurrentOpenRouterModelTokenizer } from './textgen-models.js';
1818import { SENTENCEPIECE_TOKENIZERSENCODE_TOKENIZERS, TEXTGEN_TOKENIZERS, getTextTokens, tokenizers } from './tokenizers.js';
1919import { getSortableDelay, onlyUnique } from './utils.js';
2020
2121export {
@@ -353,7 +353,7 @@ function getTokenizerForTokenIds() {
353353 return tokenizers.API_CURRENT;
354354 }
355355
356356 if (SENTENCEPIECE_TOKENIZERSENCODE_TOKENIZERS.includes(power_user.tokenizer)) {
357357 return power_user.tokenizer;
358358 }
359359
public/scripts/tokenizers.js+5 -1
@@ -33,18 +33,22 @@ export const tokenizers = {
3333 BEST_MATCH: 99,
3434};
3535
36-export const SENTENCEPIECE_TOKENIZERS = [
36+// A list of local tokenizers that support encoding and decoding token ids.
37+export const ENCODE_TOKENIZERS = [
3738 tokenizers.LLAMA,
3839 tokenizers.MISTRAL,
3940 tokenizers.YI,
4041 tokenizers.LLAMA3,
4142 tokenizers.GEMMA,
4243 tokenizers.JAMBA,
44+ tokenizers.QWEN2,
45+ tokenizers.COMMAND_R,
4346 // uncomment when NovelAI releases Kayra and Clio weights, lol
4447 //tokenizers.NERD,
4548 //tokenizers.NERD2,
4649];
4750
51+// A list of Text Completion sources that support remote tokenization.
4852export const TEXTGEN_TOKENIZERS = [OOBA, TABBY, KOBOLDCPP, LLAMACPP, VLLM, APHRODITE];
4953
5054const TOKENIZER_URLS = {