1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 setuptools,
7 numpy,
8 packaging,
9 psutil,
10 pyyaml,
11 torch,
12 transformers,
13 accelerate,
14}:
15
16buildPythonPackage rec {
17 pname = "peft";
18 version = "0.12.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.8";
22
23 src = fetchFromGitHub {
24 owner = "huggingface";
25 repo = pname;
26 rev = "refs/tags/v${version}";
27 hash = "sha256-7LYlqWiOPTvQyJgpUZeZ5Wl17RswhYyit0/MaHyN5Ak=";
28 };
29
30 nativeBuildInputs = [ setuptools ];
31
32 propagatedBuildInputs = [
33 numpy
34 packaging
35 psutil
36 pyyaml
37 torch
38 transformers
39 accelerate
40 ];
41
42 doCheck = false; # tries to download pretrained models
43 pythonImportsCheck = [ "peft" ];
44
45 meta = with lib; {
46 homepage = "https://github.com/huggingface/peft";
47 description = "State-of-the art parameter-efficient fine tuning";
48 changelog = "https://github.com/huggingface/peft/releases/tag/v${version}";
49 license = licenses.asl20;
50 maintainers = with maintainers; [ bcdarwin ];
51 };
52}