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