1
0

bring done out of loop

This commit is contained in:
Antonio 2023-06-10 04:29:01 +08:00
parent 919e4dd919
commit 2a75fd241a
2 changed files with 2 additions and 2 deletions

View File

@ -139,6 +139,8 @@ func nightmare(c *gin.Context) {
}
if !original_request.Stream {
c.JSON(200, official_types.NewChatCompletion(full_response))
} else {
c.String(200, "data: [DONE]\n\n")
}
}

View File

@ -211,8 +211,6 @@ func Handler(c *gin.Context, response *http.Response, token string, translated_r
if stream {
final_line := official_types.StopChunk(finish_reason)
c.Writer.WriteString("data: " + final_line.String() + "\n\n")
c.String(200, "data: [DONE]\n\n")
}
}
}