merge upstream

Signed-off-by: wozulong <>
This commit is contained in:
wozulong
2024-03-23 22:51:18 +08:00
76 changed files with 6014 additions and 12588 deletions

View File

@@ -188,7 +188,6 @@ func DoMidjourneyHttpRequest(c *gin.Context, timeout time.Duration, fullRequestU
auth := c.Request.Header.Get("Authorization")
if auth != "" {
auth = strings.TrimPrefix(auth, "Bearer ")
auth = strings.Split(auth, "-")[0]
req.Header.Set("mj-api-secret", auth)
}
defer cancel()

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") {