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

Please update llama.cpp #54

Open
rekire opened this issue Jan 25, 2025 · 5 comments
Open

Please update llama.cpp #54

rekire opened this issue Jan 25, 2025 · 5 comments

Comments

@rekire
Copy link

rekire commented Jan 25, 2025

Please update the project to make it compatible again with the latest releases.
I already created a script which updated the ffi code, but my knowledge about llama.cpp is too bad to fix the issues myself.

In the mean time I managed it to automate those changes. So you can inspect the roll outs here.

@rekire
Copy link
Author

rekire commented Jan 29, 2025

I managed it, that my fork compiles with one of the latest builds (b4586). However I still don't understand some parts so I commented it out without really knowing what I broke, like:

    lib.llama_sampler_chain_add(
        _smpl,
        lib.llama_sampler_init_penalties(
            lib.llama_n_vocab(model!),
            lib.llama_token_eos(model!),
            lib.llama_token_nl(model!),
            samplerParams.penaltyLastTokens,
            samplerParams.penaltyRepeat,
            samplerParams.penaltyFreq,
            samplerParams.penaltyPresent,
            samplerParams.penaltyNewline,
            samplerParams.ignoreEOS));

and

      lib.llama_sampler_chain_add(
          _smpl,
          lib.llama_sampler_init_dry(
              vocab!,
              samplerParams.dryPenalty,
              samplerParams.dryMultiplier,
              samplerParams.dryAllowedLen,
              samplerParams.dryLookback,
              seqBreakersPointer,
              numBreakers));

I have no idea what that does and how to fix it.

The cropped output from #57 is still present and it does not crash. I would be happy to get some feedback.

In order to test my changes you can change your pubspec.yaml to this:

dependencies:
  llama_cpp_dart:
    git:
      url: https://github.com/rekire/llama_cpp_dart_fork.git
      ref: 0.0.9-dev-b4586

Please note it is not required to build llama.cpp you can simply download the .so/.dylib/.dll from https://github.com/ggerganov/llama.cpp/releases/tag/b4586 (not tested with Android or iOS)

@RojasFD007
Copy link

Hi, I tried your build on my Pixel 6A and it works, I just have to place the .so file in the jniLibs folder and add the following lines in the build.gradle externalNativeBuild { cmake { cppFlags "" arguments "-DANDROID_STL=c++_shared" }

@netdur
Copy link
Owner

netdur commented Feb 10, 2025

I am working on scripts to update with llama.cpp --- if all goes well, this weekend

@rekire
Copy link
Author

rekire commented Feb 10, 2025

Feel free to check my build scripts they might be helpful: https://github.com/rekire/llama_cpp_dart_fork/tree/main/.github

@netdur
Copy link
Owner

netdur commented Feb 17, 2025

@rekire thank you sir, that's awesome

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