From 50f2169ff096968cf8afab6fa7585ed3b8c564b1 Mon Sep 17 00:00:00 2001 From: Arne Binder Date: Sun, 21 Sep 2025 22:01:54 +0200 Subject: [PATCH 1/2] remove remaining as_dataset=True from some model tests --- tests/models/test_span_tuple_classification.py | 2 +- .../test_token_classification_with_seq2seq_encoder_and_crf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/models/test_span_tuple_classification.py b/tests/models/test_span_tuple_classification.py index f984fdbdb..a158aca8e 100644 --- a/tests/models/test_span_tuple_classification.py +++ b/tests/models/test_span_tuple_classification.py @@ -55,7 +55,7 @@ def test_taskmodule_config(documents, taskmodule_config): def test_batch(documents, batch, taskmodule_config): taskmodule = RESpanPairClassificationTaskModule.from_config(taskmodule_config) - encodings = taskmodule.encode(documents, encode_target=True, as_dataset=True) + encodings = taskmodule.encode(documents, encode_target=True) batch_from_documents = taskmodule.collate(encodings[:4]) inputs, targets = batch diff --git a/tests/models/test_token_classification_with_seq2seq_encoder_and_crf.py b/tests/models/test_token_classification_with_seq2seq_encoder_and_crf.py index 5b31b2f13..ebb669f73 100644 --- a/tests/models/test_token_classification_with_seq2seq_encoder_and_crf.py +++ b/tests/models/test_token_classification_with_seq2seq_encoder_and_crf.py @@ -53,7 +53,7 @@ def test_batch(documents, batch, taskmodule_config): taskmodule = LabeledSpanExtractionByTokenClassificationTaskModule.from_config( taskmodule_config ) - encodings = taskmodule.encode(documents, encode_target=True, as_dataset=True) + encodings = taskmodule.encode(documents, encode_target=True) batch_from_documents = taskmodule.collate(encodings[:4]) inputs, targets = batch From 297d3eca9cfa011eaef066ebd957dcb7768102a6 Mon Sep 17 00:00:00 2001 From: Arne Binder Date: Sun, 21 Sep 2025 22:04:29 +0200 Subject: [PATCH 2/2] use pytorch-ie 0.32.0 (which uses pie-core 0.3.0) --- poetry.lock | 37 +++++++++++-------------------------- pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 27 deletions(-) diff --git a/poetry.lock b/poetry.lock index c9d17702b..d47c997fa 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,17 +1,5 @@ # This file is automatically @generated by Poetry 2.1.3 and should not be changed by hand. -[[package]] -name = "absl-py" -version = "1.4.0" -description = "Abseil Python Common Libraries, see https://github.com/abseil/abseil-py." -optional = false -python-versions = ">=3.6" -groups = ["main"] -files = [ - {file = "absl-py-1.4.0.tar.gz", hash = "sha256:d2c244d01048ba476e7c080bd2c6df5e141d211de80223460d5b3b8a2a58433d"}, - {file = "absl_py-1.4.0-py3-none-any.whl", hash = "sha256:0d3fe606adfa4f7db64792dd4c7aee4ee0c38ab75dfd353b7a83ed3e957fcb47"}, -] - [[package]] name = "accelerate" version = "0.32.1" @@ -1937,19 +1925,18 @@ xml = ["lxml (>=4.9.2)"] [[package]] name = "pie-core" -version = "0.2.0" +version = "0.3.0" description = "Core modules of PyTorch-IE" optional = false python-versions = "<4.0,>=3.9" groups = ["main"] files = [ - {file = "pie_core-0.2.0-py3-none-any.whl", hash = "sha256:8bb9740304c9b58246485c9170717d2b947d732d71d2a9d5176f8572d8b98b2a"}, - {file = "pie_core-0.2.0.tar.gz", hash = "sha256:7e41cbe6b554285acbcae8822d84d97c19820ddd7b27dc9751349eb48bc61eb1"}, + {file = "pie_core-0.3.0-py3-none-any.whl", hash = "sha256:0c2f6c91457c0a05826ccf127b3c40d4f4afb2862a56b82cab6f52d43066719c"}, + {file = "pie_core-0.3.0.tar.gz", hash = "sha256:ee3892ad3eee414e194005ef1eb453ec1698d37e5a0d80c5583b40f1bb4e8cca"}, ] [package.dependencies] huggingface_hub = ">=0.23.4,<0.26.0" -torch = ">=2.1.0,<3.0.0" [[package]] name = "pillow" @@ -2262,25 +2249,23 @@ files = [ [[package]] name = "pytorch-ie" -version = "0.31.9" +version = "0.32.0" description = "State-of-the-art Information Extraction in PyTorch" optional = false python-versions = "<4.0,>=3.9" groups = ["main"] files = [ - {file = "pytorch_ie-0.31.9-py3-none-any.whl", hash = "sha256:002eab323d529022e13a1ed1a7effc43e1bc172bcc11abe58c46501a8c37eb54"}, - {file = "pytorch_ie-0.31.9.tar.gz", hash = "sha256:bd516817ce759c059fcbe61c8d420367366c82014d3ba49938a61cb564102610"}, + {file = "pytorch_ie-0.32.0-py3-none-any.whl", hash = "sha256:4f4cccbb9acf5cf6903f4e4987136ec090aeaec358051952d318417a5390dc32"}, + {file = "pytorch_ie-0.32.0.tar.gz", hash = "sha256:dbcb1a0dc16ba097e0c0380eac3f39eca1af80ff541454e05190a6bd6118aa8a"}, ] [package.dependencies] -absl-py = ">=1.0.0,<2.0.0" -fsspec = "<2023.9.0" -pandas = ">=2.0.0,<3.0.0" -pie-core = ">=0.2.0,<0.3.0" +pandas = ">=2.0.0,<3" +pie-core = ">=0.2.1,<0.4.0" pytorch-lightning = ">=2,<3" torch = ">=1.10" -torchmetrics = ">=1,<2" -transformers = ">=4.18,<5.0" +torchmetrics = ">1,<2" +transformers = ">=4.18,<5" [[package]] name = "pytorch-lightning" @@ -3586,4 +3571,4 @@ test = ["big-O", "importlib-resources ; python_version < \"3.9\"", "jaraco.funct [metadata] lock-version = "2.1" python-versions = "^3.9" -content-hash = "84243d0376dded1435e1defadde55a26a8d2b1428792e307c8db139721262fe6" +content-hash = "1e5d493a4154bbdc70b68943b1992f2baa705894a4438bbf59f0913df2fcf4c9" diff --git a/pyproject.toml b/pyproject.toml index bb2f076d8..1085b3cc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,7 @@ classifiers = [ [tool.poetry.dependencies] python = "^3.9" # TODO: remove and use pie-core instead -pytorch-ie = ">=0.31.9,<0.32.0" +pytorch-ie = ">=0.31.9,<0.33.0" pytorch-lightning = "^2.1.0" torchmetrics = "^1" # >=4.35 because of BartModelWithDecoderPositionIds, <4.37 because of generation config