Provide model name for tokens counting

Although Continue now uses the Llama tokenizer for most models,
it's still important to provide the model name to the
countTokens function. This ensures flexibility in case we
introduce more specialized tokenizers for different models in
the future.
This commit is contained in:
Jazzcort 2025-04-14 11:45:02 -04:00
parent 87ad955b3b
commit ef514575eb

View file

@ -709,7 +709,7 @@ export class Core {
throw new Error("No chat model selected");
}
const tokens = countTokens(item.content);
const tokens = countTokens(item.content, llm.model);
if (tokens > llm.contextLength - llm.completionOptions!.maxTokens!) {
return true;