Skip to content

[BUG]: loglevel 0 and 1 from llama.cpp doesn't seem to be supported #995

@LoicDagnas

Description

@LoicDagnas

Description

Since this PR on llama.cpp, log levels are not anymore between 2 and 5 but between 0 and 4 here. So I guess that the log level mapping should be adapted here.

Reproduction Steps

Adding with NativeLogConfig.llama_log_set(new LlamaSharpLogger()); this very naive custom logger:

internal sealed class LlamaSharpLogger : ILogger
{
    public IDisposable BeginScope<TState>(TState state) => default;

    public void Log<TState>(
        LogLevel logLevel,
        EventId eventId,
        TState state,
        Exception exception,
        Func<TState, Exception, string> formatter)
    {

    }

    public bool IsEnabled(LogLevel logLevel) => true;
}

any call to LlamaWeights.LoadFromFile("...") will fails with an ArgumentOutOfRangeException.

Environment & Configuration

  • Operating system: Windows
  • .NET runtime version: 8.0
  • LLamaSharp version: 0.19
  • CUDA version (if you are using cuda backend): 12
  • CPU & GPU device: RTX 3000

Known Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleStale issue will be autoclosed soon

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions