Skip to content

How to load lora in the latest version #1306

@jarodxiangliu

Description

@jarodxiangliu

Description

Maybe I am missing something, but I don't found from the document about how to load lora.
I found below code mention that

            var parameters = new ModelParams(modelPath)
            {
                **LoraAdapters = adapters,**
                ContextSize = 2048,
                Seed = 1337,
                GpuLayerCount = 15,
                EmbeddingMode = true,
                Threads = (uint)(Environment.ProcessorCount * 0.7)
            };

But seems now there is no LoraAdapters in the ModelParams? Anything I am missing?

I also tried to use

var parameters = new ModelParams(_modelPath);

            using var weights = LLamaWeights.LoadFromFile(parameters);
            foreach (var lora in loras)
            {
                weights.NativeHandle.LoadLoraFromFile(lora.Path);
            }

Warning: Lora adapter loading is temporarily disabled. Please check LLamaSharp documentation for 'ApplyLoraFromFile' usage in
v0.25.0.
I didn't found any document about this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions