feat: initialize token encoders in a goroutine to reduce service startup time

This commit is contained in:
liu.vaayne 2024-07-12 21:01:30 +08:00 committed by Vaayne
parent 6ad169975f
commit 2a19e5e2f8

View File

@ -88,7 +88,7 @@ func main() {
if config.EnableMetric {
logger.SysLog("metric enabled, will disable channel if too much request failed")
}
openai.InitTokenEncoders()
go openai.InitTokenEncoders()
client.Init()
// Initialize HTTP server