"docs/source/en/using-diffusers/controlling_generation.md" did not exist on "6960e7222557da58550112f9db2b06349a80290c"
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