mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
engine: error on embeddings; not currently implemented
This commit is contained in:
parent
45a13b1dec
commit
ec46f3286c
2 changed files with 9 additions and 66 deletions
|
@ -483,8 +483,7 @@ func (s *Server) EmbedHandler(c *gin.Context) {
|
|||
}
|
||||
|
||||
if err := g.Wait(); err != nil {
|
||||
slog.Error("embedding generation failed", "error", err)
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Errorf("failed to generate embeddings: %v", err)})
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": strings.TrimSpace(err.Error())})
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -545,8 +544,7 @@ func (s *Server) EmbeddingsHandler(c *gin.Context) {
|
|||
|
||||
embedding, err := r.Embedding(c.Request.Context(), req.Prompt)
|
||||
if err != nil {
|
||||
slog.Info(fmt.Sprintf("embedding generation failed: %v", err))
|
||||
c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Errorf("failed to generate embedding: %v", err)})
|
||||
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"error": strings.TrimSpace(err.Error())})
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue