Add supports of gpt-4o tokenizer for reverse_proxy
This commit is contained in:
@@ -35,6 +35,11 @@ export async function encode(data:string):Promise<(number[]|Uint32Array|Int32Arr
|
|||||||
case 'llama3':
|
case 'llama3':
|
||||||
return await tokenizeWebTokenizers(data, 'llama')
|
return await tokenizeWebTokenizers(data, 'llama')
|
||||||
default:
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user