Unverified Commit f529626c authored by Bruce MacDonald's avatar Bruce MacDonald Committed by GitHub
Browse files

log prediction failures

parents 90ba0b80 671eec6d
......@@ -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
}
......
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