mirror of
https://github.com/linux-do/new-api.git
synced 2025-11-13 09:33:43 +08:00
merge upstream
Signed-off-by: wozulong <>
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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") {
|
||||
|
||||
Reference in New Issue
Block a user