fix: do not try to parse model when requesting /v1/models (close #1272)

This commit is contained in:
JustSong 2024-04-05 12:50:31 +08:00
parent 9a2662af0d
commit 840ef80d94

View File

@ -117,7 +117,7 @@ func TokenAuth() func(c *gin.Context) {
return return
} }
requestModel, err := getRequestModel(c) requestModel, err := getRequestModel(c)
if err != nil { if err != nil && !strings.HasPrefix(c.Request.URL.Path, "/v1/models") {
abortWithMessage(c, http.StatusBadRequest, err.Error()) abortWithMessage(c, http.StatusBadRequest, err.Error())
return return
} }