From b8fb615695c4e14bf8357ce1f77ab7d1c1f966df Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 17:44:08 +0000 Subject: [PATCH 01/10] Update to supported python/CUDA versions --- pyproject.toml | 10 ++++------ src/ai2_internal/config.yaml | 30 +++++++++++++++--------------- 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f2eb94ac..8c1992fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = 'mmda' -version = '0.9.18' +version = '0.9.25' description = 'MMDA - multimodal document analysis' authors = [ {name = 'Allen Institute for Artificial Intelligence', email = 'contact@allenai.org'}, @@ -15,7 +15,7 @@ dependencies = [ 'requests', 'pandas<2', 'pydantic[settings]>=1,<3', - 'ncls==0.0.66', + 'ncls==0.0.70', 'necessary>=0.3.2', ] @@ -118,11 +118,9 @@ bibentry_predictor_gpu = [ 'pydantic>=1,<2' ] bibentry_detection_predictor = [ - 'Pillow<10', + 'Pillow', 'layoutparser', - 'torch==1.8.0+cu111', - 'torchvision==0.9.0+cu111', - 'pydantic<=1,<2', + 'pydantic>=1,<2', ] citation_links = [ 'numpy', diff --git a/src/ai2_internal/config.yaml b/src/ai2_internal/config.yaml index 7b4dff6c..92490210 100644 --- a/src/ai2_internal/config.yaml +++ b/src/ai2_internal/config.yaml @@ -24,7 +24,7 @@ model_variants: artifacts_s3_path: s3://ai2-timo-registry/model-artifacts/vila/ivila-row-layoutlm-finetuned-s2vl-v2.tar.gz # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: 3.8 + python_version: "3.11" cuda: True @@ -51,7 +51,7 @@ model_variants: extras_require: ["dev", "lp_predictors"] # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: 3.8 + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: True @@ -88,7 +88,7 @@ model_variants: artifacts_s3_path: s3://ai2-timo-registry/model-artifacts/bibentryparser/v0.onnx.tar.gz # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: 3.8 + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: False @@ -125,7 +125,7 @@ model_variants: artifacts_s3_path: s3://ai2-timo-registry/model-artifacts/bibentryparser/v0.onnx.tar.gz # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: 3.8 + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: True @@ -163,7 +163,7 @@ model_variants: artifacts_s3_path: s3://ai2-s2-mmda/models/citation-mentions/2022-07-27-minilm-10k/model/artifacts-onnx16.tar.gz # Version of python required for model runtime - python_version: "3.8" + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: True @@ -194,7 +194,7 @@ model_variants: artifacts_s3_path: s3://ai2-timo-registry/model-artifacts/citationlinks/v1.tar.gz # Version of python required for model runtime - python_version: "3.8" + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: False @@ -222,14 +222,14 @@ model_variants: artifacts_s3_path: s3://ai2-s2-analytics/danyh/extract-stuff-from-pdfs/artifacts/anchor/archive.tar.gz # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: "3.8" + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: true - # One of the versions here: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md#ubuntu2004, but less than 11.4.3. - # If cuda=True and cuda_version is unspecified, defaults to 11.4.2. - cuda_version: "11.1.1" + # One of the versions here: https://gitlab.com/nvidia/container-images/cuda/blob/master/doc/supported-tags.md#ubuntu2204 + # If cuda=True and cuda_version is unspecified, defaults to 11.8.0. + cuda_version: "11.8.0" # Python path to a fn in == that # returns a unittest.TestCase. Builder function receives a model container @@ -243,9 +243,9 @@ model_variants: # pip installing dependencies listed in setup.py so that detectron2 installs successfully docker_run_commands: [ "apt-get update && apt-get install -y poppler-utils libgl1", - "pip install layoutparser", - "pip install torch==1.8.0+cu111 torchvision==0.9.0+cu111 -f https://download.pytorch.org/whl/torch_stable.html", - "pip install 'detectron2@git+https://github.com/facebookresearch/detectron2.git@v0.6#egg=detectron2'"] + "pip install torch==2.4.1+cu118 torchvision==0.19.1+cu118 --index-url https://download.pytorch.org/whl/cu118", + "pip install https://github.com/miropsota/torch_packages_builder/releases/download/detectron2-0.6%2Bfd27788/detectron2-0.6%2Bfd27788pt2.4.1cu118-cp311-cp311-linux_x86_64.whl", + "pip install layoutparser"] # Any additional sets of dependencies required by the model. # These are the 'extras_require' keys in your setup.py. @@ -267,7 +267,7 @@ model_variants: integration_test: ai2_internal.figure_table_predictors.integration_test.TestInterfaceIntegration # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: 3.8 + python_version: "3.11" cuda: False @@ -305,7 +305,7 @@ model_variants: artifacts_s3_path: null # Version of python required for model runtime, e.g. 3.7, 3.8, 3.9 - python_version: 3.8 + python_version: "3.11" # Whether this model supports CUDA GPU acceleration cuda: false From f79f42ee77f2dde26e5d923a2723bf4800926cf0 Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 18:54:35 +0000 Subject: [PATCH 02/10] wip --- .github/workflows/mmda-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/mmda-ci.yml b/.github/workflows/mmda-ci.yml index fc439211..8412ef20 100644 --- a/.github/workflows/mmda-ci.yml +++ b/.github/workflows/mmda-ci.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.9", "3.8"] + python-version: ["3.11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} architecture: x64 @@ -35,10 +35,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.11' architecture: x64 - run: | sudo apt-get update @@ -53,13 +53,13 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: - python-version: '3.8' + python-version: '3.11' architecture: x64 - run: | sudo apt-get update - run: | pip install -e .[dev,svm_word_predictor] - pytest tests/test_predictors/test_svm_word_predictor.py --no-cov \ No newline at end of file + pytest tests/test_predictors/test_svm_word_predictor.py --no-cov From 5a8f47b9550bf6401d7418255022a6698fca3f6f Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 19:07:41 +0000 Subject: [PATCH 03/10] wip --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8c1992fe..cadcce62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = 'mmda' -version = '0.9.25' +version = '0.9.26' description = 'MMDA - multimodal document analysis' authors = [ {name = 'Allen Institute for Artificial Intelligence', email = 'contact@allenai.org'}, @@ -14,6 +14,7 @@ dependencies = [ 'pdfplumber==0.7.4', 'requests', 'pandas<2', + 'numpy<2', 'pydantic[settings]>=1,<3', 'ncls==0.0.70', 'necessary>=0.3.2', From 5f430b2f0f26b1a038b470e6b7d9d7c1f428fbbe Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 19:30:27 +0000 Subject: [PATCH 04/10] wip --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index cadcce62..bd0de240 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,7 +126,7 @@ bibentry_detection_predictor = [ citation_links = [ 'numpy', 'thefuzz[speedup]', - 'scikit-learn', + 'scikit-learn<1.3', 'xgboost', 'pydantic>=1,<2', ] @@ -140,7 +140,7 @@ figure_table_predictors = [ 'pydantic>=1,<2', ] svm_word_predictor = [ - 'scikit-learn', + 'scikit-learn<1.3', 'scipy', 'numpy', 'tokenizers', @@ -154,7 +154,7 @@ recipes = [ 'effdet', 'vila>=0.5,<0.6', 'smashed==0.1.10', - 'scikit-learn', + 'scikit-learn<1.3', 'scipy', 'numpy', 'tokenizers', From 21f49c7e81e8709921dcf3789e80b784a93965d1 Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 19:56:21 +0000 Subject: [PATCH 05/10] wip --- pyproject.toml | 98 +++++++++++++++++++++++++------------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bd0de240..a9a3036c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,15 +9,15 @@ license = {text = 'Apache-2.0'} readme = 'README.md' requires-python = '>=3.7' dependencies = [ - 'tqdm', - 'pdf2image', + 'tqdm<5', + 'pdf2image<2', 'pdfplumber==0.7.4', - 'requests', + 'requests<3', 'pandas<2', 'numpy<2', 'pydantic[settings]>=1,<3', 'ncls==0.0.70', - 'necessary>=0.3.2', + 'necessary>=0.3.2,<1', ] [project.urls] @@ -60,33 +60,33 @@ requires = [ [project.optional-dependencies] dev = [ - 'pytest', - 'pytest-xdist', - 'pytest-cov', + 'pytest<10', + 'pytest-xdist<4', + 'pytest-cov<8', ] grobid_augment_existing_document_parser = [ 'grobid-client-python==0.0.5' ] spacy_predictors = [ - 'spacy', + 'spacy<4', ] pysbd_predictors = [ - 'pysbd', + 'pysbd<1', ] heuristic_predictors = [ - 'tokenizers', + 'tokenizers<1', 'pydantic>=1,<2', ] lp_predictors = [ - 'layoutparser', - 'torch', - 'torchvision', - 'effdet', + 'layoutparser<1', + 'torch<3', + 'torchvision<1', + 'effdet<1', 'pydantic>=1,<2' ] hf_predictors = [ - 'torch', - 'transformers', + 'torch<3', + 'transformers<6', 'smashed==0.1.10', ] vila_predictors = [ @@ -95,70 +95,70 @@ vila_predictors = [ 'pydantic>=1,<2', ] mention_predictor = [ - 'transformers[torch]', - 'optimum[onnxruntime]', + 'transformers[torch]<6', + 'optimum[onnxruntime]<3', 'pydantic>=1,<2', ] mention_predictor_gpu = [ - 'transformers[torch]', - 'optimum[onnxruntime-gpu]', + 'transformers[torch]<6', + 'optimum[onnxruntime-gpu]<3', 'pydantic>=1,<2', ] bibentry_predictor = [ - 'transformers', - 'unidecode', - 'torch', - 'optimum[onnxruntime]', + 'transformers<6', + 'unidecode<2', + 'torch<3', + 'optimum[onnxruntime]<3', 'pydantic>=1,<2', ] bibentry_predictor_gpu = [ - 'transformers', - 'unidecode', - 'torch', - 'optimum[onnxruntime-gpu]', + 'transformers<6', + 'unidecode<2', + 'torch<3', + 'optimum[onnxruntime-gpu]<3', 'pydantic>=1,<2' ] bibentry_detection_predictor = [ - 'Pillow', - 'layoutparser', + 'Pillow<13', + 'layoutparser<1', 'pydantic>=1,<2', ] citation_links = [ - 'numpy', - 'thefuzz[speedup]', + 'numpy<2', + 'thefuzz[speedup]<1', 'scikit-learn<1.3', - 'xgboost', + 'xgboost<3', 'pydantic>=1,<2', ] section_nesting = [ - 'numpy', - 'scipy', - 'xgboost', + 'numpy<2', + 'scipy<2', + 'xgboost<3', ] figure_table_predictors = [ - 'scipy', + 'scipy<2', 'pydantic>=1,<2', ] svm_word_predictor = [ 'scikit-learn<1.3', - 'scipy', - 'numpy', - 'tokenizers', + 'scipy<2', + 'numpy<2', + 'tokenizers<1', 'pydantic>=1,<2', ] recipes = [ - 'layoutparser', - 'transformers', - 'torch', - 'torchvision', - 'effdet', + 'layoutparser<1', + 'transformers<6', + 'torch<3', + 'torchvision<1', + 'effdet<1', 'vila>=0.5,<0.6', 'smashed==0.1.10', 'scikit-learn<1.3', - 'scipy', - 'numpy', - 'tokenizers', - 'xgboost', + 'scipy<2', + 'numpy<2', + 'tokenizers<1', + 'xgboost<3', ] From 74fe04ea4160f0702d14c5590143550d24668bde Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 20:41:41 +0000 Subject: [PATCH 06/10] wip --- pyproject.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a9a3036c..f272f117 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -127,13 +127,13 @@ citation_links = [ 'numpy<2', 'thefuzz[speedup]<1', 'scikit-learn<1.3', - 'xgboost<3', + 'xgboost<2', 'pydantic>=1,<2', ] section_nesting = [ 'numpy<2', 'scipy<2', - 'xgboost<3', + 'xgboost<2', ] figure_table_predictors = [ 'scipy<2', @@ -158,7 +158,7 @@ recipes = [ 'scipy<2', 'numpy<2', 'tokenizers<1', - 'xgboost<3', + 'xgboost<2', ] From fe1dd68f581b5f34df01014e13c11673899fd7c7 Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 20:43:17 +0000 Subject: [PATCH 07/10] wip --- .github/workflows/mmda-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/mmda-ci.yml b/.github/workflows/mmda-ci.yml index 8412ef20..8b87677c 100644 --- a/.github/workflows/mmda-ci.yml +++ b/.github/workflows/mmda-ci.yml @@ -27,6 +27,7 @@ jobs: sudo apt-get -y install poppler-utils pip install -e .[dev,pysbd_predictors,hf_predictors,lp_predictors,recipes,grobid_augment_existing_document_parser] pytest --cov-fail-under=42 \ + --log-level=WARNING \ --ignore=tests/test_predictors/test_vila_predictors.py \ --ignore=tests/test_predictors/test_figure_table_predictors.py \ --ignore=tests/test_predictors/test_section_nesting_predictor.py From 7f13870576d52aec38f393188703a628a912f367 Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Fri, 27 Feb 2026 21:07:19 +0000 Subject: [PATCH 08/10] wip --- .github/workflows/mmda-ci.yml | 1 - pyproject.toml | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/mmda-ci.yml b/.github/workflows/mmda-ci.yml index 8b87677c..8412ef20 100644 --- a/.github/workflows/mmda-ci.yml +++ b/.github/workflows/mmda-ci.yml @@ -27,7 +27,6 @@ jobs: sudo apt-get -y install poppler-utils pip install -e .[dev,pysbd_predictors,hf_predictors,lp_predictors,recipes,grobid_augment_existing_document_parser] pytest --cov-fail-under=42 \ - --log-level=WARNING \ --ignore=tests/test_predictors/test_vila_predictors.py \ --ignore=tests/test_predictors/test_figure_table_predictors.py \ --ignore=tests/test_predictors/test_section_nesting_predictor.py diff --git a/pyproject.toml b/pyproject.toml index f272f117..266b2e4f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -133,6 +133,7 @@ citation_links = [ section_nesting = [ 'numpy<2', 'scipy<2', + 'scikit-learn<1.3', 'xgboost<2', ] figure_table_predictors = [ @@ -170,7 +171,7 @@ pythonpath = [ ] python_classes = ['Test*', '*Test'] log_format = '%(asctime)s - %(levelname)s - %(name)s - %(message)s' -log_level = 'DEBUG' +log_level = 'WARNING' markers = [] filterwarnings = [] From b3d703e5611f19388ed65c383ee8c9695f0ad9a3 Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Sat, 28 Feb 2026 00:00:59 +0000 Subject: [PATCH 09/10] wip --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 266b2e4f..14864786 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,7 @@ hf_predictors = [ ] vila_predictors = [ 'vila>=0.5,<0.6', - 'transformers<4.34.0', + 'transformers<4.30', 'pydantic>=1,<2', ] mention_predictor = [ From 0bc1a1718cfd9ea0ce6831ed578330b3d981e291 Mon Sep 17 00:00:00 2001 From: Rodney Kinney Date: Sat, 28 Feb 2026 00:36:50 +0000 Subject: [PATCH 10/10] wip --- pyproject.toml | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 14864786..77aeac15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -78,14 +78,14 @@ heuristic_predictors = [ 'pydantic>=1,<2', ] lp_predictors = [ - 'layoutparser<1', - 'torch<3', - 'torchvision<1', - 'effdet<1', + 'layoutparser>=0.3,<0.4', + 'torch>=2.0,<2.1', + 'torchvision>=0.15,<0.16', + 'effdet>=0.3,<0.4', 'pydantic>=1,<2' ] hf_predictors = [ - 'torch<3', + 'torch>=2.0,<2.1', 'transformers<6', 'smashed==0.1.10', ] @@ -107,20 +107,20 @@ mention_predictor_gpu = [ bibentry_predictor = [ 'transformers<6', 'unidecode<2', - 'torch<3', + 'torch>=2.0,<2.1', 'optimum[onnxruntime]<3', 'pydantic>=1,<2', ] bibentry_predictor_gpu = [ 'transformers<6', 'unidecode<2', - 'torch<3', + 'torch>=2.0,<2.1', 'optimum[onnxruntime-gpu]<3', 'pydantic>=1,<2' ] bibentry_detection_predictor = [ - 'Pillow<13', - 'layoutparser<1', + 'Pillow>=9.3,<10', + 'layoutparser>=0.3,<0.4', 'pydantic>=1,<2', ] citation_links = [ @@ -148,11 +148,11 @@ svm_word_predictor = [ 'pydantic>=1,<2', ] recipes = [ - 'layoutparser<1', + 'layoutparser>=0.3,<0.4', 'transformers<6', - 'torch<3', - 'torchvision<1', - 'effdet<1', + 'torch>=2.0,<2.1', + 'torchvision>=0.15,<0.16', + 'effdet>=0.3,<0.4', 'vila>=0.5,<0.6', 'smashed==0.1.10', 'scikit-learn<1.3',