diff options
author | Pash Shocky <pashashocky@gmail.com> | 2019-12-06 18:40:29 +0000 |
---|---|---|
committer | Jon <jonringer@users.noreply.github.com> | 2019-12-17 16:46:52 -0800 |
commit | dae6544457901efcc458801b771da768e92cc8a4 (patch) | |
tree | 574b23d3055026d12116920754b985f76a75f26f /pkgs/development/python-modules | |
parent | 16d9c2a5702511b03bb3700fb717060491cc1252 (diff) | |
download | nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.tar nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.tar.gz nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.tar.bz2 nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.tar.lz nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.tar.xz nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.tar.zst nixpkgs-dae6544457901efcc458801b771da768e92cc8a4.zip |
transformers: init at 2.2.1
Diffstat (limited to 'pkgs/development/python-modules')
-rw-r--r-- | pkgs/development/python-modules/transformers/default.nix | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/transformers/default.nix b/pkgs/development/python-modules/transformers/default.nix new file mode 100644 index 00000000000..09ebf739d7d --- /dev/null +++ b/pkgs/development/python-modules/transformers/default.nix @@ -0,0 +1,41 @@ +{ buildPythonPackage +, stdenv +, fetchFromGitHub +, sacremoses +, requests +, sentencepiece +, boto3 +, tqdm +, regex +, numpy +, pytest +}: + +buildPythonPackage rec { + pname = "transformers"; + version = "2.2.1"; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = pname; + rev = "v${version}"; + sha256 = "1p8p3lhhiyk1xl9gpgq4vbchyz57v3w7hhvsj1r90zs3cckindl8"; + }; + + propagatedBuildInputs = [ numpy sacremoses requests sentencepiece boto3 tqdm regex ]; + + checkInputs = [ pytest ]; + # pretrained tries to download from s3 + checkPhase = '' + cd transformers # avoid importing local files + HOME=$TMPDIR pytest -k 'not pretrained_tokenizers' + ''; + + meta = with stdenv.lib; { + homepage = "https://github.com/huggingface/transformers"; + description = "State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch"; + license = licenses.asl20; + platforms = [ "x86_64-linux" ]; + maintainers = with maintainers; [ pashashocky ]; + }; +} |