Skip to content
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

Running a simple example and I get : System.EntryPointNotFoundException Unable to find an entry point named 'llama_init_backend' in DLL 'libllama'. #109

Closed
DavidLuong98 opened this issue Aug 22, 2023 · 1 comment

Comments

@DavidLuong98
Copy link

DavidLuong98 commented Aug 22, 2023

I've installed :
LlamaSharp : 0.4.0
LlamaSharp.Backend.Cpu : 0.4.2-preview

With the following example :

string stModelPath = @"pathfoo\llama-2-7b-guanaco-qlora.ggmlv3.q4_1.bin";

var ex = new InteractiveExecutor(new LLamaModel(new ModelParams(stModelPath, contextSize: 1024, seed: 1337, gpuLayerCount: 5)));

I get this crash shortly :

The type initializer for 'LLama.Native.NativeApi' threw an exception.
   at LLama.Native.NativeApi.llama_context_default_params()
   at LLama.Utils.InitLLamaContextFromModelParams(ModelParams params)
   at LLama.LLamaModel..ctor(ModelParams Params, String encoding, ILLamaLogger logger)
   at Dom.AI.TccLLama.Foo() in C:\Users\david\foo\TccLLama.cs:line 13
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
   at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)

System.EntryPointNotFoundException
Unable to find an entry point named 'llama_init_backend' in DLL 'libllama'.
   at LLama.Native.NativeApi.llama_init_backend()
   at LLama.Native.NativeApi..cctor()

I've looked into issue #2 and seen that installing the module worked.
I've verified that the two nuget packages are installed under .nuget and that libllama.dll does exist in runtimes\win-x64\native

Any suggestions on how to proceed?

@DavidLuong98 DavidLuong98 changed the title Simple example gets : System.EntryPointNotFoundException Unable to find an entry point named 'llama_init_backend' in DLL 'libllama'. Running a simple example and I get : System.EntryPointNotFoundException Unable to find an entry point named 'llama_init_backend' in DLL 'libllama'. Aug 22, 2023
@martindevans
Copy link
Member

You've installed 0.4.0 of the main package and 0.4.2-preview of the backend package - these aren't compatible! Make sure you always use the same version of both.

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