ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / transformers / default.nix
blobe445dd7e8db3029c13af88edf91e7d91b8de95a1
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pythonOlder
5 , cookiecutter
6 , filelock
7 , huggingface-hub
8 , importlib-metadata
9 , regex
10 , requests
11 , numpy
12 , packaging
13 , tensorflow
14 , sagemaker
15 , ftfy
16 , protobuf
17 , scikit-learn
18 , pillow
19 , pyyaml
20 , torch
21 , tokenizers
22 , tqdm
25 buildPythonPackage rec {
26   pname = "transformers";
27   version = "4.24.0";
28   format = "setuptools";
30   disabled = pythonOlder "3.7";
32   src = fetchFromGitHub {
33     owner = "huggingface";
34     repo = pname;
35     rev = "refs/tags/v${version}";
36     hash = "sha256-aGtTey+QK12URZcGNaRAlcaOphON4ViZOGdigtXU1g0=";
37   };
39   propagatedBuildInputs = [
40     filelock
41     huggingface-hub
42     numpy
43     protobuf
44     packaging
45     pyyaml
46     regex
47     requests
48     tokenizers
49     tqdm
50   ] ++ lib.optionals (pythonOlder "3.8") [
51     importlib-metadata
52   ];
54   passthru.optional-dependencies = {
55     ja = [
56       # fugashi
57       # ipadic
58       # unidic_lite
59       # unidic
60     ];
61     sklearn = [
62       scikit-learn
63     ];
64     tf = [
65       tensorflow
66       # onnxconverter-common
67       # tf2onnx
68     ];
69     torch = [
70       torch
71     ];
72     tokenizers = [
73       tokenizers
74     ];
75     modelcreation = [
76       cookiecutter
77     ];
78     sagemaker = [
79       sagemaker
80     ];
81     ftfy = [ ftfy ];
82     onnx = [
83       # onnxconverter-common
84       # tf2onnx
85     ];
86     vision = [
87       pillow
88     ];
89   };
92   # Many tests require internet access.
93   doCheck = false;
95   pythonImportsCheck = [
96     "transformers"
97   ];
99   meta = with lib; {
100     homepage = "https://github.com/huggingface/transformers";
101     description = "Natural Language Processing for TensorFlow 2.0 and PyTorch";
102     changelog = "https://github.com/huggingface/transformers/releases/tag/v${version}";
103     license = licenses.asl20;
104     platforms = platforms.unix;
105     maintainers = with maintainers; [ pashashocky ];
106   };