Rework custom API

This commit is contained in:
kwaroran
2024-11-25 23:04:32 +09:00
parent 8274fae180
commit cc8d753dc8
4 changed files with 42 additions and 64 deletions

View File

@@ -41,12 +41,7 @@ export async function encode(data:string):Promise<(number[]|Uint32Array|Int32Arr
case 'cohere':
return await tokenizeWebTokenizers(data, 'cohere')
default:
// Add exception for gpt-4o tokenizers on reverse_proxy
if(db.proxyRequestModel?.startsWith('gpt4o') ||
(db.proxyRequestModel === 'custom' && db.customProxyRequestModel.startsWith('gpt-4o'))) {
return await tikJS(data, 'o200k_base')
}
return await tikJS(data)
return await tikJS(data, 'o200k_base')
}
}
if(db.aiModel.startsWith('novellist')){