2023-04-29 16:46:19 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pythonOlder
|
|
|
|
, setuptools
|
|
|
|
, numpy
|
|
|
|
, packaging
|
|
|
|
, psutil
|
|
|
|
, pyyaml
|
|
|
|
, torch
|
|
|
|
, transformers
|
|
|
|
, accelerate
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "peft";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.4.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}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-riOCe43/2xUpE6TTCEpMndeFTbaBN4JFDlv90tqVO4Y=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|