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

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

Merged
merged 1 commit into from
Mar 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions pkgs/development/python-modules/llama-cpp-python/default.nix
Original file line number Diff line number Diff line change
@@ -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=";
})
];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to have an empty list for patches here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed


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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you deepClone then the version will actually be extracted from the (submodule) git revision; and then you don't need to override it with the variable here. These two are mutually exclusive.

]
++ lib.optionals cudaSupport [
"-DGGML_CUDA=on"
"-DCUDAToolkit_ROOT=${lib.getDev cudaPackages.cuda_nvcc}"