From 671eec6da9ed18cfed2d5804a564eb8276fc796d Mon Sep 17 00:00:00 2001 From: Bruce MacDonald Date: Mon, 31 Jul 2023 16:46:37 -0400 Subject: [PATCH] log prediction failures --- server/routes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routes.go b/server/routes.go index cc9df958..ec01378c 100644 --- a/server/routes.go +++ b/server/routes.go @@ -129,6 +129,7 @@ func GenerateHandler(c *gin.Context) { } if err := activeSession.llm.Predict(req.Context, prompt, fn); err != nil { + log.Printf("llm.Predict failed with %s", err) ch <- gin.H{"error": err.Error()} } }() @@ -345,11 +346,13 @@ func streamResponse(c *gin.Context, ch chan any) { bts, err := json.Marshal(val) if err != nil { + log.Printf("streamResponse: json.Marshal failed with %s", err) return false } bts = append(bts, '\n') if _, err := w.Write(bts); err != nil { + log.Printf("streamResponse: w.Write failed with %s", err) return false }