Merge pull request #175086 from fabaff/spacy-transformers-fix
python310Packages.spacy-transformers: relax transformers constraint
This commit is contained in:
commit
075bccccde
@ -33,6 +33,11 @@ buildPythonPackage rec {
|
|||||||
dataclasses
|
dataclasses
|
||||||
];
|
];
|
||||||
|
|
||||||
|
postPatch = ''
|
||||||
|
substituteInPlace setup.cfg \
|
||||||
|
--replace "transformers>=3.4.0,<4.18.0" "transformers>=3.4.0 # ,<4.18.0"
|
||||||
|
'';
|
||||||
|
|
||||||
# Test fails due to missing arguments for trfs2arrays().
|
# Test fails due to missing arguments for trfs2arrays().
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
{ buildPythonPackage
|
{ lib
|
||||||
, lib
|
, buildPythonPackage
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, pythonOlder
|
, pythonOlder
|
||||||
, cookiecutter
|
, cookiecutter
|
||||||
@ -10,9 +10,14 @@
|
|||||||
, requests
|
, requests
|
||||||
, numpy
|
, numpy
|
||||||
, packaging
|
, packaging
|
||||||
|
, tensorflow
|
||||||
|
, sagemaker
|
||||||
|
, ftfy
|
||||||
, protobuf
|
, protobuf
|
||||||
|
, scikit-learn
|
||||||
|
, pillow
|
||||||
, pyyaml
|
, pyyaml
|
||||||
, sacremoses
|
, torch
|
||||||
, tokenizers
|
, tokenizers
|
||||||
, tqdm
|
, tqdm
|
||||||
}:
|
}:
|
||||||
@ -20,42 +25,80 @@
|
|||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "transformers";
|
pname = "transformers";
|
||||||
version = "4.19.2";
|
version = "4.19.2";
|
||||||
|
format = "setuptools";
|
||||||
|
|
||||||
|
disabled = pythonOlder "3.7";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "huggingface";
|
owner = "huggingface";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "refs/tags/v${version}";
|
rev = "refs/tags/v${version}";
|
||||||
sha256 = "sha256-9r/1vW7Rhv9+Swxdzu5PTnlQlT8ofJeZamHf5X4ql8w=";
|
hash = "sha256-9r/1vW7Rhv9+Swxdzu5PTnlQlT8ofJeZamHf5X4ql8w=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ packaging ];
|
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = [
|
||||||
cookiecutter
|
|
||||||
filelock
|
filelock
|
||||||
huggingface-hub
|
huggingface-hub
|
||||||
numpy
|
numpy
|
||||||
protobuf
|
protobuf
|
||||||
|
packaging
|
||||||
pyyaml
|
pyyaml
|
||||||
regex
|
regex
|
||||||
requests
|
requests
|
||||||
sacremoses
|
|
||||||
tokenizers
|
tokenizers
|
||||||
tqdm
|
tqdm
|
||||||
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
|
] ++ lib.optionals (pythonOlder "3.8") [
|
||||||
|
importlib-metadata
|
||||||
|
];
|
||||||
|
|
||||||
|
passthru.optional-dependencies = {
|
||||||
|
ja = [
|
||||||
|
# fugashi
|
||||||
|
# ipadic
|
||||||
|
# unidic_lite
|
||||||
|
# unidic
|
||||||
|
];
|
||||||
|
sklearn = [
|
||||||
|
scikit-learn
|
||||||
|
];
|
||||||
|
tf = [
|
||||||
|
tensorflow
|
||||||
|
# onnxconverter-common
|
||||||
|
# tf2onnx
|
||||||
|
];
|
||||||
|
torch = [
|
||||||
|
torch
|
||||||
|
];
|
||||||
|
tokenizers = [
|
||||||
|
tokenizers
|
||||||
|
];
|
||||||
|
modelcreation = [
|
||||||
|
cookiecutter
|
||||||
|
];
|
||||||
|
sagemaker = [
|
||||||
|
sagemaker
|
||||||
|
];
|
||||||
|
ftfy = [ ftfy ];
|
||||||
|
onnx = [
|
||||||
|
# onnxconverter-common
|
||||||
|
# tf2onnx
|
||||||
|
];
|
||||||
|
vision = [
|
||||||
|
pillow
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
# Many tests require internet access.
|
# Many tests require internet access.
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
postPatch = ''
|
pythonImportsCheck = [
|
||||||
sed -ri 's/tokenizers[=>]=[^"]+/tokenizers/g' setup.py src/transformers/dependency_versions_table.py
|
"transformers"
|
||||||
'';
|
];
|
||||||
|
|
||||||
pythonImportsCheck = [ "transformers" ];
|
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
homepage = "https://github.com/huggingface/transformers";
|
homepage = "https://github.com/huggingface/transformers";
|
||||||
description = "State-of-the-art Natural Language Processing for TensorFlow 2.0 and PyTorch";
|
description = "Natural Language Processing for TensorFlow 2.0 and PyTorch";
|
||||||
changelog = "https://github.com/huggingface/transformers/releases/tag/v${version}";
|
changelog = "https://github.com/huggingface/transformers/releases/tag/v${version}";
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
|
Loading…
Reference in New Issue
Block a user