From 5074871a0ee1ae83a53da65f4744bef75a28b8c6 Mon Sep 17 00:00:00 2001 From: anagri <127566+anagri@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:31:43 +0530 Subject: [PATCH 1/2] Fixing typos in build.rs for framework Accelerate. Fixing doctest expectation based on llama.cpp implementation --- llama-cpp-2/src/model/params.rs | 3 +++ llama-cpp-sys-2/build.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/llama-cpp-2/src/model/params.rs b/llama-cpp-2/src/model/params.rs index b4d5a25e..b9f6c4b4 100644 --- a/llama-cpp-2/src/model/params.rs +++ b/llama-cpp-2/src/model/params.rs @@ -180,7 +180,10 @@ impl LlamaModelParams { /// ``` /// # use llama_cpp_2::model::params::LlamaModelParams; /// let params = LlamaModelParams::default(); +/// #[cfg(not(target_os = "macos"))] /// assert_eq!(params.n_gpu_layers(), 0, "n_gpu_layers should be 0"); +/// #[cfg(target_os = "macos")] +/// assert_eq!(params.n_gpu_layers(), 999, "n_gpu_layers should be 0"); /// assert_eq!(params.main_gpu(), 0, "main_gpu should be 0"); /// assert_eq!(params.vocab_only(), false, "vocab_only should be false"); /// assert_eq!(params.use_mmap(), true, "use_mmap should be true"); diff --git a/llama-cpp-sys-2/build.rs b/llama-cpp-sys-2/build.rs index b7768514..5d14cea5 100644 --- a/llama-cpp-sys-2/build.rs +++ b/llama-cpp-sys-2/build.rs @@ -130,7 +130,7 @@ fn main() { llama_cpp.define("GGML_USE_ACCELERATE", None); llama_cpp.define("ACCELERATE_NEW_LAPACK", None); llama_cpp.define("ACCELERATE_LAPACK_ILP64", None); - println!("cargo:rustc-link-arg=framework=Accelerate"); + println!("cargo:rustc-link-lib=framework=Accelerate"); metal_hack(&mut ggml); ggml.include("./llama.cpp/ggml-metal.h"); From 909e8d4f53adc5d055a1d0a394cf52ef3c44b709 Mon Sep 17 00:00:00 2001 From: anagri <127566+anagri@users.noreply.github.com> Date: Wed, 20 Mar 2024 16:34:33 +0530 Subject: [PATCH 2/2] Updating the comment for doctest --- llama-cpp-2/src/model/params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llama-cpp-2/src/model/params.rs b/llama-cpp-2/src/model/params.rs index b9f6c4b4..92a2ccdb 100644 --- a/llama-cpp-2/src/model/params.rs +++ b/llama-cpp-2/src/model/params.rs @@ -183,7 +183,7 @@ impl LlamaModelParams { /// #[cfg(not(target_os = "macos"))] /// assert_eq!(params.n_gpu_layers(), 0, "n_gpu_layers should be 0"); /// #[cfg(target_os = "macos")] -/// assert_eq!(params.n_gpu_layers(), 999, "n_gpu_layers should be 0"); +/// assert_eq!(params.n_gpu_layers(), 999, "n_gpu_layers should be 999"); /// assert_eq!(params.main_gpu(), 0, "main_gpu should be 0"); /// assert_eq!(params.vocab_only(), false, "vocab_only should be false"); /// assert_eq!(params.use_mmap(), true, "use_mmap should be true");