Skip to content

[BUG]: Unable to run KernelMemory example in latest build due to System.TypeLoadException #1079

Description

@footh

Description

I receive this error when trying to run the KernelMemory example:

Unhandled exception. System.TypeLoadException: Method 'GenerateTextAsync' in type 'LLamaSharp.KernelMemory.LlamaSharpTextGenerator' from assembly 'LLamaSharp.KernelMemory, Version=0.21.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.
at LLamaSharp.KernelMemory.BuilderExtensions.WithLLamaSharpDefaults(IKernelMemoryBuilder builder, LLamaSharpConfig config, LLamaWeights weights, LLamaContext context)
at LLama.Examples.Examples.KernelMemory.CreateMemory(String modelPath) in c:\Users\jeff\projects\LLamaSharp\LLama.Examples\Examples\KernelMemory.cs:line 85
at LLama.Examples.Examples.KernelMemory.Run() in c:\Users\jeff\projects\LLamaSharp\LLama.Examples\Examples\KernelMemory.cs:line 29
at ExampleRunner.Run() in c:\Users\jeff\projects\LLamaSharp\LLama.Examples\ExampleRunner.cs:line 58
at Program.

$(String[] args) in c:\Users\jeff\projects\LLamaSharp\LLama.Examples\Program.cs:line 38
at Program.(String[] args)

Reproduction Steps

  1. Clone the repository
  2. Open in VS code at the root folder
  3. Open Program.cs in the LLamaSharp.Examples sub-project and click Run->Run Without Debugging
  4. Navigate in the embedded terminal to KernelMemory : Document Q&A
  5. Error occurs and app quits

(Note: I am pretty new to the .NET infrastructure so hopefully this isn't something simple but it seems pretty straightforward and other examples I've tried work fine)

Environment & Configuration

  • Operating system: Windows 11
  • .NET runtime version: 8.0
  • LLamaSharp version: 0.21.0 (was also having this issue on 0.20.0
  • CUDA version (if you are using cuda backend): 12
  • CPU & GPU device: i9-13900HX, 4080 laptop

Known Workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions