Commit f96eda85 authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

python312Packages.colbert-ai: fix import

parent 8161b1cb
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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 = [