python3Packages.transformers: don't import torch.distributed on darwin

This patch is in the same spirit as
d842a192cb where import for
torch.distributed was patched out for darwin. This other instance of the
incorrect import was spotted while packaging lm-eval through the latter
test suite.
This commit is contained in:
Ihar Hrachyshka
2025-01-20 20:55:30 -05:00
parent 94921298c6
commit 519a42334f
@@ -2,6 +2,7 @@
lib,
buildPythonPackage,
fetchFromGitHub,
fetchpatch,
# build-system
setuptools,
@@ -68,6 +69,15 @@ buildPythonPackage rec {
hash = "sha256-jh2bMmvTC0G0kLJl7xXpsvXvBmlbZEDA88AfosoE9sA=";
};
patches = [
# Remove on the next major version bump
(fetchpatch {
url = "https://github.com/huggingface/transformers/commit/db864b5526d56fd99143619abff969bfcb5596d5.patch?full_index=1";
name = "dont-import-torch-distributed-if-not-available.patch";
hash = "sha256-XOraJmSt9Rp/oNiil6vDUBqZhd8MDbA0nz1Tx16Mk14=";
})
];
build-system = [ setuptools ];
dependencies = [