"...api/git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "b58868e6f4781dc3b2c2b7ad6617d430e7e41a87"
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) { ...@@ -192,7 +192,7 @@ func GenerateHandler(c *gin.Context) {
} }
if model.IsEmbedding() { 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 return
} }
...@@ -1149,7 +1149,7 @@ func ChatHandler(c *gin.Context) { ...@@ -1149,7 +1149,7 @@ func ChatHandler(c *gin.Context) {
} }
if model.IsEmbedding() { 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 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