mirror of
https://github.com/ollama/ollama
synced 2026-04-23 08:45:14 +00:00
server: emit load and total durations for a load
This commit is contained in:
parent
5c5535c064
commit
6b6746b5b4
|
|
@ -191,6 +191,10 @@ func (s *Server) GenerateHandler(c *gin.Context) {
|
|||
CreatedAt: time.Now().UTC(),
|
||||
Done: true,
|
||||
DoneReason: "load",
|
||||
Metrics: api.Metrics{
|
||||
LoadDuration: checkpointLoaded.Sub(checkpointStart),
|
||||
TotalDuration: checkpointLoaded.Sub(checkpointStart),
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
@ -1443,6 +1447,10 @@ func (s *Server) ChatHandler(c *gin.Context) {
|
|||
Message: api.Message{Role: "assistant"},
|
||||
Done: true,
|
||||
DoneReason: "load",
|
||||
Metrics: api.Metrics{
|
||||
LoadDuration: checkpointLoaded.Sub(checkpointStart),
|
||||
TotalDuration: checkpointLoaded.Sub(checkpointStart),
|
||||
},
|
||||
})
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue