From cef3cf353ac964a818a9e8a1cecb7a3cfd6a617a Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 20 Dec 2024 13:39:51 -0800 Subject: [PATCH] estimate log value --- llm/memory.go | 6 +++--- llm/server.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llm/memory.go b/llm/memory.go index fdfe798f9..2f930d75f 100644 --- a/llm/memory.go +++ b/llm/memory.go @@ -338,7 +338,7 @@ func EstimateGPULayers(gpus []discover.GpuInfo, f *ggml.GGML, projectors []strin return estimate } -func (m MemoryEstimate) log() { +func (m MemoryEstimate) LogValue() slog.Value { overhead := envconfig.GpuOverhead() log := slog.With() @@ -352,8 +352,8 @@ func (m MemoryEstimate) log() { ) } - log.Info( - "offload to "+m.inferenceLibrary, + return slog.GroupValue( + slog.String("library", m.inferenceLibrary), slog.Group( "layers", // requested number of layers to offload diff --git a/llm/server.go b/llm/server.go index 134f5d8a3..dc38979ca 100644 --- a/llm/server.go +++ b/llm/server.go @@ -139,7 +139,7 @@ func NewLlamaServer(gpus discover.GpuInfoList, model string, f *ggml.GGML, adapt } } - estimate.log() + slog.Info("offload", "", estimate) // Loop through potential servers finalErr := errors.New("no suitable llama servers found")