python312Packages.transformers: fix darwin by skipping torch.distributed import (#362768)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
buildPythonPackage,
|
||||
fetchFromGitHub,
|
||||
|
||||
@@ -68,6 +69,15 @@ buildPythonPackage rec {
|
||||
hash = "sha256-TQQ+w+EH/KWLE7iaaAHGxfE74hCiLXcqlIr1TIBFGvo=";
|
||||
};
|
||||
|
||||
# torch.distributed is not available on darwin
|
||||
# Fix submitted upstream in https://github.com/huggingface/transformers/pull/35133
|
||||
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
substituteInPlace src/transformers/pytorch_utils.py \
|
||||
--replace-fail \
|
||||
'if is_torch_greater_or_equal("2.5"):' \
|
||||
'if False:'
|
||||
'';
|
||||
|
||||
build-system = [ setuptools ];
|
||||
|
||||
dependencies = [
|
||||
|
||||
Reference in New Issue
Block a user