mirror of
https://github.com/ollama/ollama.git
synced 2026-10-21 02:51:35 +00:00
better error message when calling /api/generate or /api/chat with embedding models
This commit is contained in:
parent
63861f58cc
commit
287ba11500
1 changed files with 2 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue