This commit is contained in:
josc146
2024-03-22 15:33:48 +08:00
parent d53d8b8614
commit 9773a5d196
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -35,7 +35,7 @@ export async function cropText(
tiktoken = true,
) {
const userConfig = await getUserConfig()
const k = Models[userConfig.modelName].desc.match(/[- ]*([0-9]+)k/)?.[1]
const k = Models[userConfig.modelName].desc.match(/[- (]*([0-9]+)k/)?.[1]
if (k) {
maxLength = Number(k) * 1000
maxLength -= 100 + clamp(userConfig.maxResponseTokenLength, 1, maxLength - 1000)