mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-16 13:13:41 +08:00
fix only extract and record the most critical part.
Because sometimes when certain models transfer files, the error information here becomes too long, leading to very large log sizes. Therefore, I hope that only the most critical parts are extracted and recorded when an error is logged here.
This commit is contained in:
@@ -102,7 +102,8 @@ func CountTokenMessages(messages []model.Message, model string) int {
|
||||
}
|
||||
imageTokens, err := countImageTokens(url, detail)
|
||||
if err != nil {
|
||||
logger.SysError("error counting image tokens: " + err.Error())
|
||||
//Due to the excessive length of the error information, only extract and record the most critical part.
|
||||
logger.SysError(fmt.Sprintf("error counting image tokens. Error type: %T", err))
|
||||
} else {
|
||||
tokenNum += imageTokens
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user