nixpkgs/pkgs/development/python-modules/transformers/default.nix
Daniël de Kok 6f2ce2a65e treewide: remove danieldk as maintainer from a set of packages
I currently do not have much time to work on nixpkgs. Remove
myself as a maintainer from a bunch of packages to avoid that
people are waiting on me for a review.
2021-09-12 14:42:12 +00:00

61 lines
1.3 KiB
Nix

{ buildPythonPackage
, lib
, fetchFromGitHub
, pythonOlder
, cookiecutter
, filelock
, importlib-metadata
, regex
, requests
, numpy
, packaging
, protobuf
, sacremoses
, tokenizers
, tqdm
}:
buildPythonPackage rec {
pname = "transformers";
version = "4.4.2";
src = fetchFromGitHub {
owner = "huggingface";
repo = pname;
rev = "v${version}";
hash = "sha256-kl1Z2FBo+yqVXUqLaUtet6IycmdcAtfydNTI4MNNrkc=";
};
nativeBuildInputs = [ packaging ];
propagatedBuildInputs = [
cookiecutter
filelock
numpy
protobuf
regex
requests
sacremoses
tokenizers
tqdm
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
# Many tests require internet access.
doCheck = false;
postPatch = ''
sed -ri 's/tokenizers[=>]=[^"]+/tokenizers/g' setup.py src/transformers/dependency_versions_table.py
'';
pythonImportsCheck = [ "transformers" ];
meta = with lib; {
homepage = "https://github.com/huggingface/transformers";
description = "State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch";
changelog = "https://github.com/huggingface/transformers/releases/tag/v${version}";
license = licenses.asl20;
platforms = platforms.unix;
maintainers = with maintainers; [ pashashocky ];
};
}