[fix] tokenizer problem 2

This commit is contained in:
kwaroran
2023-06-10 02:38:36 +09:00
parent 6fc60805e6
commit 08cd214bcb
3 changed files with 6 additions and 1 deletions

View File

@@ -202,7 +202,10 @@ export async function sendChat(chatProcessIndex = -1,arg:{chatAdditonalTokens?:n
let currentTokens = 0
for(const key in unformated){
currentTokens += await tokenizer.tokenizeChat(unformated[key])
const chats = unformated[key] as OpenAIChat[]
for(const chat of chats){
currentTokens += await tokenizer.tokenizeChat(chat)
}
}