We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c776d4b + d842a19 commit 28a594aCopy full SHA for 28a594a
pkgs/development/python-modules/transformers/default.nix
@@ -1,5 +1,6 @@
1
{
2
lib,
3
+ stdenv,
4
buildPythonPackage,
5
fetchFromGitHub,
6
@@ -68,6 +69,15 @@ buildPythonPackage rec {
68
69
hash = "sha256-TQQ+w+EH/KWLE7iaaAHGxfE74hCiLXcqlIr1TIBFGvo=";
70
};
71
72
+ # torch.distributed is not available on darwin
73
+ # Fix submitted upstream in https://github.com/huggingface/transformers/pull/35133
74
+ postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
75
+ substituteInPlace src/transformers/pytorch_utils.py \
76
+ --replace-fail \
77
+ 'if is_torch_greater_or_equal("2.5"):' \
78
+ 'if False:'
79
+ '';
80
+
81
build-system = [ setuptools ];
82
83
dependencies = [
0 commit comments