python3Packages.llama-cpp-python: 0.3.6 -> 0.3.8 (#391734)

This commit is contained in:
kirillrdy
2025-03-22 14:52:59 +11:00
committed by GitHub
@@ -4,7 +4,6 @@
gcc13Stdenv,
buildPythonPackage,
fetchFromGitHub,
fetchpatch2,
# nativeBuildInputs
cmake,
@@ -40,28 +39,18 @@ let
in
buildPythonPackage rec {
pname = "llama-cpp-python";
version = "0.3.6";
version = "0.3.8";
pyproject = true;
src = fetchFromGitHub {
owner = "abetlen";
repo = "llama-cpp-python";
tag = "v${version}";
hash = "sha256-d5nMgpS7m6WEILs222ztwphoqkAezJ+qt6sVKSlpIYI=";
hash = "sha256-F1E1c2S1iIL3HX/Sot/uIIrOWvfPU1dCrHx14A1Jn9E=";
fetchSubmodules = true;
};
# src = /home/gaetan/llama-cpp-python;
patches = [
# fix segfault when running tests due to missing default Metal devices
(fetchpatch2 {
url = "https://github.com/ggml-org/llama.cpp/commit/acd38efee316f3a5ed2e6afcbc5814807c347053.patch?full_index=1";
stripLen = 1;
extraPrefix = "vendor/llama.cpp/";
hash = "sha256-71+Lpg9z5KPlaQTX9D85KS2LXFWLQNJJ18TJyyq3/pU=";
})
];
dontUseCmakeConfigure = true;
SKBUILD_CMAKE_ARGS = lib.strings.concatStringsSep ";" (
# Set GGML_NATIVE=off. Otherwise, cmake attempts to build with
@@ -72,7 +61,10 @@ buildPythonPackage rec {
# -mcpu, breaking linux build as follows:
#
# cc1: error: unknown value native+nodotprod+noi8mm+nosve for -mcpu
[ "-DGGML_NATIVE=off" ]
[
"-DGGML_NATIVE=off"
"-DGGML_BUILD_NUMBER=1"
]
++ lib.optionals cudaSupport [
"-DGGML_CUDA=on"
"-DCUDAToolkit_ROOT=${lib.getDev cudaPackages.cuda_nvcc}"