mirror of
https://github.com/linux-do/new-api.git
synced 2025-09-17 07:56:38 +08:00
fix: try to fix minimax (close #327)
This commit is contained in:
parent
1e2c1ee950
commit
11be36dafd
@ -187,7 +187,7 @@ func OpenaiHandler(c *gin.Context, resp *http.Response, promptTokens int, model
|
||||
return service.OpenAIErrorWrapper(err, "close_response_body_failed", http.StatusInternalServerError), nil
|
||||
}
|
||||
|
||||
if simpleResponse.Usage.TotalTokens == 0 {
|
||||
if simpleResponse.Usage.TotalTokens == 0 || (simpleResponse.Usage.PromptTokens == 0 && simpleResponse.Usage.CompletionTokens == 0) {
|
||||
completionTokens := 0
|
||||
for _, choice := range simpleResponse.Choices {
|
||||
ctkm, _ := service.CountTokenText(string(choice.Message.Content), model)
|
||||
|
Loading…
Reference in New Issue
Block a user