2021-05-20 23:08:51 +00:00
|
|
|
{ lib
|
|
|
|
, callPackage
|
|
|
|
, fetchPypi
|
|
|
|
, buildPythonPackage
|
|
|
|
, pytorch
|
2021-10-06 13:57:05 +00:00
|
|
|
, pythonOlder
|
2021-05-20 23:08:51 +00:00
|
|
|
, spacy
|
|
|
|
, spacy-alignments
|
|
|
|
, srsly
|
|
|
|
, transformers
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "spacy-transformers";
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "1.1.4";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.6";
|
2021-05-20 23:08:51 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-04-15 01:41:22 +00:00
|
|
|
sha256 = "sha256-G09bZiXTdEuukvKjPOYYTW/B19d406QSRDOU5ZflDDU=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
2022-02-10 20:34:41 +00:00
|
|
|
sed -i 's/transformers>=3.4.0,<4.13.0/transformers/' setup.cfg
|
2021-12-06 16:07:01 +00:00
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
pytorch
|
|
|
|
spacy
|
|
|
|
spacy-alignments
|
|
|
|
srsly
|
|
|
|
transformers
|
|
|
|
];
|
|
|
|
|
|
|
|
# Test fails due to missing arguments for trfs2arrays().
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "spacy_transformers" ];
|
|
|
|
|
|
|
|
passthru.tests.annotation = callPackage ./annotation-test { };
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "spaCy pipelines for pretrained BERT, XLNet and GPT-2";
|
|
|
|
homepage = "https://github.com/explosion/spacy-transformers";
|
|
|
|
license = licenses.mit;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
}
|