Skip to content
This repository has been archived by the owner on Mar 20, 2024. It is now read-only.

Commit

Permalink
fix imitate api invalid model in response
Browse files Browse the repository at this point in the history
  • Loading branch information
linweiyuan committed Jul 23, 2023
1 parent d2e4bbf commit 8fc4b7a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/imitate/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func CreateChatCompletions(c *gin.Context) {
}

if !originalRequest.Stream {
c.JSON(200, newChatCompletion(fullResponse))
c.JSON(200, newChatCompletion(fullResponse, translatedRequest.Model))
} else {
c.String(200, "data: [DONE]\n\n")
}
Expand Down
4 changes: 2 additions & 2 deletions api/imitate/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,12 @@ type StringStruct struct {
}

//goland:noinspection SpellCheckingInspection
func newChatCompletion(fullTest string) ChatCompletion {
func newChatCompletion(fullTest, model string) ChatCompletion {
return ChatCompletion{
ID: "chatcmpl-QXlha2FBbmROaXhpZUFyZUF3ZXNvbWUK",
Object: "chat.completion",
Created: int64(0),
Model: "gpt-3.5-turbo-0301",
Model: model,
Usage: usage{
PromptTokens: 0,
CompletionTokens: 0,
Expand Down

0 comments on commit 8fc4b7a

Please sign in to comment.