Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
footh opened this issue Feb 2, 2025 · 3 comments

Comments

@footh
Copy link

footh commented Feb 2, 2025

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

@martindevans
Copy link
Member

I've just opened #1081 which should fix this. Could you clone that branch and test it out?

@footh
Copy link
Author

footh commented Feb 2, 2025

Seems to work fine now. Thanks!

@martindevans
Copy link
Member

Thaks for testing that, I've merged the PR so it'll be in the next release (roughly once a month)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants