Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
llama: update llama.cpp to latest version (#244)
* llama: update llama.cpp to latest version This commit updates llama.cpp to the latest/later version. The motivation for this is that the current version of llama.cpp is a little outdated and there have been changes to the llama.cpp API and also the model format. Currently it is not possible to use the new GGUF format and many of the available models are in this new format which can make it challenging to use this crate at the moment. The following changes have been made: * update llama.cpp to latest version using git submodule update --remote --merge llama.cpp * Manually copied the generated bindings.rs file from the target directory to the src directory. Hope this was the correct thing to do. * Updated the llm-chain-llama crate to use llama_decode instead of llm_eval which has now been deprecated. Signed-off-by: Daniel Bevenius <[email protected]> * build: increase timeout to 30 mins for ci jobs This is an attempt to fix builds from returning: ``` Error: The operation was canceled. ``` Signed-off-by: Daniel Bevenius <[email protected]> * build: add fail-fast: false to build strategy This is an attempt to prevent the currently failing windows build from causing the other builds to be cancelled (at least that is what I think is happening). Signed-off-by: Daniel Bevenius <[email protected]> * hnsw: update to hnsw_rs 0.2 This commit is an attempt to update the hnsw dependency to version 0.2 and to fix the currently failing windows build of hswn_rs version 0.1.19 which is current failing to compile on windows: ```console error[E0308]: mismatched types --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hnsw_rs-0.1.19\src\libext.rs:439:39 | 439 | let c_dist = DistCFFI::<f32>::new(c_func); | -------------------- ^^^^^^ expected `u32`, found `u64` | | | arguments to this function are incorrect | = note: expected fn pointer `extern "C" fn(_, _, u32) -> _` found fn pointer `extern "C" fn(_, _, u64) -> _` note: associated function defined here --> C:\Users\runneradmin\.cargo\registry\src\index.crates.io-6f17d22bba15001f\hnsw_rs-0.1.19\src\dist.rs:990:12 | 990 | pub fn new(f:DistCFnPtr<T>) -> Self { | ^^^ --------------- ``` I was able to reproduce this issue locally by cross compiling (which produces the above error). But cross compiling with version 0.2 work and so I've attempted to upgrade to that version. This is very much a suggestion as I'm not familiar with the hnsw code but perhaps it will be useful to someone else and save some time investigating the issue. Signed-off-by: Daniel Bevenius <[email protected]> * build: write bindings to src directory This commit changes the build.rs script to write the generated bindings to the src directory to avoid manual copying of the bindings.rs file. Signed-off-by: Daniel Bevenius <[email protected]> * doc: add instructions for updating llama.cpp Signed-off-by: Daniel Bevenius <[email protected]> * src: update llama.cpp submodule Signed-off-by: Daniel Bevenius <[email protected]> * squash! llama: update llama.cpp to latest version This commit revert the change to the StopSequence option in llm-chain-llama/src/options.rs. Signed-off-by: Daniel Bevenius <[email protected]> * squash! llama: update llama.cpp to latest version This commit removes the `From<llama_batch> for LlamaBatch` impl as it is no longer needed. Signed-off-by: Daniel Bevenius <[email protected]> * squash! llama: update llama.cpp to latest version This commit creates a new LlamaBatch for new token sampled instead of reusing the same one. Signed-off-by: Daniel Bevenius <[email protected]> * squash! llama: update llama.cpp to latest version This commit extracts the logic for checking if the prompt is a question into a separate conditional check. I've tried to clarify the comment of this check as well so it is hopefully easier to understand now. Signed-off-by: Daniel Bevenius <[email protected]> --------- Signed-off-by: Daniel Bevenius <[email protected]>
- Loading branch information