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:
parent
87ad955b3b
commit
ef514575eb
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue