"git@developer.sourcefind.cn:change/sglang.git" did not exist on "02973cd9a4513e9139c65effffd6d87db1ae8318"
Commit 287ba115 authored by Jeffrey Morgan's avatar Jeffrey Morgan
Browse files

better error message when calling `/api/generate` or `/api/chat` with embedding models

parent 63861f58
......@@ -192,7 +192,7 @@ func GenerateHandler(c *gin.Context) {
}
if model.IsEmbedding() {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "model does not support generate"})
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "embedding models do not support generate"})
return
}
......@@ -1149,7 +1149,7 @@ func ChatHandler(c *gin.Context) {
}
if model.IsEmbedding() {
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "model does not support chat"})
c.AbortWithStatusJSON(http.StatusBadRequest, gin.H{"error": "embedding models do not support chat"})
return
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment