Skip to content

java.lang.NoSuchFieldError: de.kherud.llama.InferenceParameters.antiPrompt [Ljava/lang/String; #31

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
enimatek-nl opened this issue Dec 4, 2023 · 2 comments

Comments

@enimatek-nl
Copy link

Just like the issues #26 #30 #27 I had this issue on a Linux machine (amd64).
From the failed pipeline on github I added the artifacts that were build with success and changed the path paramter.
But this will result in the following error:

java.lang.NoSuchFieldError: de.kherud.llama.InferenceParameters.antiPrompt [Ljava/lang/String;
    at jdk.internal.loader.NativeLibraries.load (Native Method)
    at jdk.internal.loader.NativeLibraries$NativeLibraryImpl.open (NativeLibraries.java:331)
    at jdk.internal.loader.NativeLibraries.loadLibrary (NativeLibraries.java:197)
    at jdk.internal.loader.NativeLibraries.loadLibrary (NativeLibraries.java:139)
    at java.lang.ClassLoader.loadLibrary (ClassLoader.java:2418)
    at java.lang.Runtime.load0 (Runtime.java:852)
    at java.lang.System.load (System.java:2021)
    at de.kherud.llama.LlamaLoader.loadNativeLibrary (LlamaLoader.java:162)
    at de.kherud.llama.LlamaLoader.loadNativeLibrary (LlamaLoader.java:106)
    at de.kherud.llama.LlamaLoader.initialize (LlamaLoader.java:66)
    at de.kherud.llama.LlamaModel.<clinit> (LlamaModel.java:29)
    at nl.enimatek.llama.chat.Main.main (Main.java:16)
    at org.codehaus.mojo.exec.ExecJavaMojo.lambda$execute$0 (ExecJavaMojo.java:283)
    at java.lang.Thread.run (Thread.java:1583)

I also 'rebuild' the whole project including the llama-ccp on my M2 macbook where the current Maven-jar -does- work, but rebuilding it gives the same result as the above.

So I think, even after getting the pipeline to publish the updated llama libraries (that is now causing all the above mentioned open issues), the JNI will break anyways, maybe because of an update in the llama-ccp? - I'm not proficient in c++/jni enough atm, and the reason for me to use this library ;)

@peerkoel
Copy link

This probably has to do with a difference in "antiprompt" in the jni definition and "antiPrompt" with capital P in the Java class definition. I had the same issue when using the library as a maven dependency. Using the code from the repo in my project works for me, together with building the shared library.

@kherud
Copy link
Owner

kherud commented Apr 7, 2024

I just released version 3.0 and this should be fixed. Note, that the naming changed to InferenceParameters#setStopStrings(String[]).

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

3 participants