1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5, pytestCheckHook
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.3.0";
19 format = "pyproject";
20
21 disabled = pythonOlder "3.7";
22
23 src = fetchFromGitHub {
24 owner = "huggingface";
25 repo = pname;
26 rev = "refs/tags/v${version}";
27 hash = "sha256-7j//SDuld2ANxEcG4R0rK5vEaTX7gQwWRH56PO2KqAY=";
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; # tried to download pretrained model
43 pythonImportsCheck = [
44 "peft"
45 ];
46
47 meta = with lib; {
48 homepage = "https://github.com/huggingface/peft";
49 description = "State-of-the art parameter-efficient fine tuning";
50 changelog = "https://github.com/huggingface/peft/releases/tag/v${version}";
51 license = licenses.asl20;
52 maintainers = with maintainers; [ bcdarwin ];
53 };
54}