From 287ba115004b6bf034f7e7f8d4cd5ef2aab0e5e3 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Tue, 20 Feb 2024 21:53:45 -0500 Subject: [PATCH] better error message when calling `/api/generate` or `/api/chat` with embedding models --- server/routes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/routes.go b/server/routes.go index 254d26ad..dd14d4f8 100644 --- a/server/routes.go +++ b/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 }