瀏覽代碼

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

Jeffrey Morgan 1 年之前
父節點
當前提交
287ba11500
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      server/routes.go

+ 2 - 2
server/routes.go

@@ -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
 	}