Loading pkgs/development/python-modules/colbert-ai/default.nix +14 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,15 @@ buildPythonPackage rec { hash = "sha256-qNb9tOInLysI7Tf45QlgchYNhBXR5AWFdRiYt35iW6s="; }; # ImportError: cannot import name 'AdamW' from 'transformers' # https://github.com/stanford-futuredata/ColBERT/pull/390 postPatch = '' substituteInPlace colbert/training/training.py \ --replace-fail \ "from transformers import AdamW, get_linear_schedule_with_warmup" \ "from transformers import get_linear_schedule_with_warmup; from torch.optim import AdamW" ''; pythonRemoveDeps = [ "git-python" ]; build-system = [ Loading Loading @@ -65,5 +74,10 @@ buildPythonPackage rec { maintainers = with lib.maintainers; [ bachp ]; badPlatforms = [ # `import torch.distributed.tensor` fails on darwin: # ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a packag lib.systems.inspect.patterns.isDarwin ]; }; } Loading
pkgs/development/python-modules/colbert-ai/default.nix +14 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,15 @@ buildPythonPackage rec { hash = "sha256-qNb9tOInLysI7Tf45QlgchYNhBXR5AWFdRiYt35iW6s="; }; # ImportError: cannot import name 'AdamW' from 'transformers' # https://github.com/stanford-futuredata/ColBERT/pull/390 postPatch = '' substituteInPlace colbert/training/training.py \ --replace-fail \ "from transformers import AdamW, get_linear_schedule_with_warmup" \ "from transformers import get_linear_schedule_with_warmup; from torch.optim import AdamW" ''; pythonRemoveDeps = [ "git-python" ]; build-system = [ Loading Loading @@ -65,5 +74,10 @@ buildPythonPackage rec { maintainers = with lib.maintainers; [ bachp ]; badPlatforms = [ # `import torch.distributed.tensor` fails on darwin: # ModuleNotFoundError: No module named 'torch._C._distributed_c10d'; 'torch._C' is not a packag lib.systems.inspect.patterns.isDarwin ]; }; }