2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
|
|
|
, numpy
|
|
|
|
, packaging
|
|
|
|
, psutil
|
|
|
|
, pyyaml
|
|
|
|
, torch
|
|
|
|
, transformers
|
|
|
|
, accelerate
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "peft";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.10.0";
|
2023-04-29 16:46:19 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2023-04-29 16:46:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "huggingface";
|
|
|
|
repo = pname;
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-Aln5WyDgNnxOUwyhOz9NGsnV1zXt/Rs57ULxR5ZJXNM=";
|
2023-04-29 16:46:19 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ setuptools ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
packaging
|
|
|
|
psutil
|
|
|
|
pyyaml
|
|
|
|
torch
|
|
|
|
transformers
|
|
|
|
accelerate
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
doCheck = false; # tries to download pretrained models
|
2023-04-29 16:46:19 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"peft"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/huggingface/peft";
|
|
|
|
description = "State-of-the art parameter-efficient fine tuning";
|
|
|
|
changelog = "https://github.com/huggingface/peft/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ bcdarwin ];
|
|
|
|
};
|
|
|
|
}
|