Просмотр исходного кода

fix: update model selection logic for image edits in distributor middleware

CaIon 9 месяцев назад
Родитель
Сommit
ea04e6bcc5
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      middleware/distributor.go

+ 1 - 1
middleware/distributor.go

@@ -185,7 +185,7 @@ func getModelRequest(c *gin.Context) (*ModelRequest, bool, error) {
 	if strings.HasPrefix(c.Request.URL.Path, "/v1/images/generations") {
 	if strings.HasPrefix(c.Request.URL.Path, "/v1/images/generations") {
 		modelRequest.Model = common.GetStringIfEmpty(modelRequest.Model, "dall-e")
 		modelRequest.Model = common.GetStringIfEmpty(modelRequest.Model, "dall-e")
 	} else if strings.HasPrefix(c.Request.URL.Path, "/v1/images/edits") {
 	} else if strings.HasPrefix(c.Request.URL.Path, "/v1/images/edits") {
-		modelRequest.Model = common.GetStringIfEmpty(modelRequest.Model, "gpt-image-1")
+		modelRequest.Model = common.GetStringIfEmpty(c.PostForm("model"), "gpt-image-1")
 	}
 	}
 	if strings.HasPrefix(c.Request.URL.Path, "/v1/audio") {
 	if strings.HasPrefix(c.Request.URL.Path, "/v1/audio") {
 		relayMode := relayconstant.RelayModeAudioSpeech
 		relayMode := relayconstant.RelayModeAudioSpeech