Unverified Commit 2e384a01 authored by kirillrdy's avatar kirillrdy Committed by GitHub
Browse files

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

parents c38d0c59 7e69ba35
Loading
Loading
Loading
Loading
+6 −14
Original line number Diff line number Diff line
@@ -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}"