Added error handling for unsupported image size in

relayImageHelper function
This commit is contained in:
ckt1031 2023-11-15 20:01:14 +08:00
parent 4f90276473
commit 7b5efd9f3e

View File

@ -96,6 +96,8 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
sizeRatio *= 1.5
}
}
} else {
return errorWrapper(errors.New("size not supported"), "size_not_supported", http.StatusBadRequest)
}
quota := int(ratio*sizeRatio*1000) * imageRequest.N