fix: 模型固定价格为空时错误使用默认价格

This commit is contained in:
CaIon
2024-03-23 17:19:29 +08:00
parent d0acecb2ab
commit 67332bc8df
3 changed files with 24 additions and 24 deletions

View File

@@ -29,7 +29,7 @@ func InitTokenEncoders() {
if err != nil {
common.FatalLog(fmt.Sprintf("failed to get gpt-4 token encoder: %s", err.Error()))
}
for model, _ := range common.ModelRatio {
for model, _ := range common.DefaultModelRatio {
if strings.HasPrefix(model, "gpt-3.5") {
tokenEncoderMap[model] = gpt35TokenEncoder
} else if strings.HasPrefix(model, "gpt-4") {