ce641f4048
GitOrigin-RevId: bc5d68306b40b8522ffb69ba6cff91898c2fbbff
49 lines
1,004 B
Nix
49 lines
1,004 B
Nix
{ lib
|
|
, callPackage
|
|
, fetchPypi
|
|
, buildPythonPackage
|
|
, pytorch
|
|
, pythonOlder
|
|
, spacy
|
|
, spacy-alignments
|
|
, srsly
|
|
, transformers
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "spacy-transformers";
|
|
version = "1.1.2";
|
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "b84c195dc21a28582579dea3f76c90222e29ee0d99b6adf38ade75646ed2746e";
|
|
};
|
|
|
|
postPatch = ''
|
|
sed -i 's/transformers>=3.4.0,<4.12.0/transformers/' setup.cfg
|
|
'';
|
|
|
|
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;
|
|
maintainers = with maintainers; [ ];
|
|
};
|
|
}
|