Refine debug logging for llm

This wires up logging in llama.cpp to always go to stderr, and also
turns up logging if OLLAMA_DEBUG is set.
This commit is contained in:
Daniel Hiltgen
2024-01-22 12:26:49 -08:00
parent 5f81a33f43
commit 730dcfcc7a
3 changed files with 13 additions and 5 deletions

View File

@@ -136,6 +136,12 @@ func newDynExtServer(library, model string, adapters, projectors []string, opts
sparams.n_threads = C.uint(opts.NumThread)
if debug := os.Getenv("OLLAMA_DEBUG"); debug != "" {
sparams.verbose_logging = C.bool(true)
} else {
sparams.verbose_logging = C.bool(false)
}
slog.Info("Initializing llama server")
initResp := newExtServerResp(128)
defer freeExtServerResp(initResp)