python312Packages.llama-cpp-python: 0.3.1 -> 0.3.2
Diff: https://github.com/abetlen/llama-cpp-python/compare/refs/tags/v0.3.1...v0.3.2
This commit is contained in:
@@ -2,47 +2,53 @@
|
||||
lib,
|
||||
stdenv,
|
||||
buildPythonPackage,
|
||||
cmake,
|
||||
fetchFromGitHub,
|
||||
gitUpdater,
|
||||
|
||||
# nativeBuildInputs
|
||||
cmake,
|
||||
ninja,
|
||||
|
||||
# build-system
|
||||
pathspec,
|
||||
pyproject-metadata,
|
||||
pytestCheckHook,
|
||||
pythonOlder,
|
||||
scikit-build-core,
|
||||
|
||||
# buildInputs
|
||||
apple-sdk_11,
|
||||
|
||||
# dependencies
|
||||
diskcache,
|
||||
jinja2,
|
||||
numpy,
|
||||
typing-extensions,
|
||||
|
||||
# tests
|
||||
scipy,
|
||||
huggingface-hub,
|
||||
|
||||
# passthru
|
||||
gitUpdater,
|
||||
pytestCheckHook,
|
||||
llama-cpp-python,
|
||||
|
||||
config,
|
||||
cudaSupport ? config.cudaSupport,
|
||||
cudaPackages ? { },
|
||||
|
||||
diskcache,
|
||||
jinja2,
|
||||
numpy,
|
||||
typing-extensions,
|
||||
scipy,
|
||||
huggingface-hub,
|
||||
}:
|
||||
let
|
||||
version = "0.3.1";
|
||||
in
|
||||
buildPythonPackage {
|
||||
buildPythonPackage rec {
|
||||
pname = "llama-cpp-python";
|
||||
inherit version;
|
||||
version = "0.3.2";
|
||||
pyproject = true;
|
||||
|
||||
disabled = pythonOlder "3.7";
|
||||
|
||||
stdenv = if cudaSupport then cudaPackages.backendStdenv else stdenv;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "abetlen";
|
||||
repo = "llama-cpp-python";
|
||||
rev = "refs/tags/v${version}";
|
||||
hash = "sha256-eO1zvNJZBE5BCnbgbh00tFIRWBCWor1lIsrLXs/HFds=";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-RtM5acaflUkPOZ/VS3afcMLbsnu6z7D8nXqpN8SR7v8=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
# src = /home/gaetan/llama-cpp-python;
|
||||
|
||||
dontUseCmakeConfigure = true;
|
||||
SKBUILD_CMAKE_ARGS = lib.strings.concatStringsSep ";" (
|
||||
@@ -56,21 +62,28 @@ buildPythonPackage {
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
ninja
|
||||
];
|
||||
|
||||
build-system = [
|
||||
pathspec
|
||||
pyproject-metadata
|
||||
scikit-build-core
|
||||
];
|
||||
|
||||
buildInputs = lib.optionals cudaSupport (
|
||||
with cudaPackages;
|
||||
[
|
||||
cuda_cudart # cuda_runtime.h
|
||||
cuda_cccl # <thrust/*>
|
||||
libcublas # cublas_v2.h
|
||||
]
|
||||
);
|
||||
buildInputs =
|
||||
lib.optionals cudaSupport (
|
||||
with cudaPackages;
|
||||
[
|
||||
cuda_cudart # cuda_runtime.h
|
||||
cuda_cccl # <thrust/*>
|
||||
libcublas # cublas_v2.h
|
||||
]
|
||||
)
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
apple-sdk_11
|
||||
];
|
||||
|
||||
propagatedBuildInputs = [
|
||||
dependencies = [
|
||||
diskcache
|
||||
jinja2
|
||||
numpy
|
||||
@@ -91,12 +104,15 @@ buildPythonPackage {
|
||||
|
||||
pythonImportsCheck = [ "llama_cpp" ];
|
||||
|
||||
passthru.updateScript = gitUpdater { rev-prefix = "v"; };
|
||||
passthru.tests.llama-cpp-python = llama-cpp-python.override { cudaSupport = true; };
|
||||
passthru = {
|
||||
updateScript = gitUpdater { rev-prefix = "v"; };
|
||||
tests.llama-cpp-python = llama-cpp-python.override { cudaSupport = true; };
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Python bindings for llama.cpp";
|
||||
homepage = "https://github.com/abetlen/llama-cpp-python";
|
||||
changelog = "https://github.com/abetlen/llama-cpp-python/blob/v${version}/CHANGELOG.md";
|
||||
license = lib.licenses.mit;
|
||||
maintainers = with lib.maintainers; [ kirillrdy ];
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user