"...text-generation-inference.git" did not exist on "97f7a22f0b0f57edc840beaf152e7fd102ed8311"
Unverified Commit f602ab4d authored by Daniel Hiltgen's avatar Daniel Hiltgen Committed by GitHub
Browse files

expose underlying error on embedding failure (#7743)

Avoid a round-trip asking users for logs to see what went wrong.
parent 807ace5b
...@@ -507,7 +507,7 @@ func (s *Server) EmbeddingsHandler(c *gin.Context) { ...@@ -507,7 +507,7 @@ func (s *Server) EmbeddingsHandler(c *gin.Context) {
embedding, err := r.Embedding(c.Request.Context(), req.Prompt) embedding, err := r.Embedding(c.Request.Context(), req.Prompt)
if err != nil { if err != nil {
slog.Info(fmt.Sprintf("embedding generation failed: %v", err)) slog.Info(fmt.Sprintf("embedding generation failed: %v", err))
c.JSON(http.StatusInternalServerError, gin.H{"error": "failed to generate embedding"}) c.JSON(http.StatusInternalServerError, gin.H{"error": fmt.Errorf("failed to generate embedding: %v", err)})
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