Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
bring done out of loop
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonio committed Jun 9, 2023
1 parent 919e4dd commit 2a75fd2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 2 additions & 0 deletions handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}

}
2 changes: 0 additions & 2 deletions internal/chatgpt/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
}
}
Expand Down

0 comments on commit 2a75fd2

Please sign in to comment.