Skip to content

Commit 6f57f8f

Browse files
authored
unpin numpy and raise min for onnx higher to be compatible (#416)
This PR allows the library to be compatible with `numpy>=2`.
1 parent 5ea3895 commit 6f57f8f

File tree

8 files changed

+22
-18
lines changed

8 files changed

+22
-18
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.8.10
2+
3+
* feat: unpin `numpy` and bump minimum for `onnxruntime` to be compatible with `numpy>=2`
4+
15
## 0.8.9
26

37
* chore: unpin `pdfminer-six` version

requirements/base.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
-c constraints.in
22
python-multipart
33
huggingface-hub
4-
numpy<2
4+
numpy
55
opencv-python!=4.7.0.68
66
onnx
7-
onnxruntime>=1.17.0
7+
onnxruntime>=1.18.0
88
matplotlib
99
torch
1010
timm

requirements/base.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ flatbuffers==25.2.10
2929
# via onnxruntime
3030
fonttools==4.56.0
3131
# via matplotlib
32-
fsspec==2025.2.0
32+
fsspec==2025.3.0
3333
# via
3434
# huggingface-hub
3535
# torch
36-
huggingface-hub==0.29.2
36+
huggingface-hub==0.29.3
3737
# via
3838
# -r requirements/base.in
3939
# timm
@@ -57,7 +57,7 @@ mpmath==1.3.0
5757
# via sympy
5858
networkx==3.2.1
5959
# via torch
60-
numpy==1.26.4
60+
numpy==2.0.2
6161
# via
6262
# -r requirements/base.in
6363
# contourpy
@@ -134,7 +134,7 @@ sympy==1.13.1
134134
# torch
135135
timm==1.0.15
136136
# via -r requirements/base.in
137-
tokenizers==0.21.0
137+
tokenizers==0.21.1
138138
# via transformers
139139
torch==2.6.0
140140
# via

requirements/dev.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ asttokens==3.0.0
2121
# via stack-data
2222
async-lru==2.0.4
2323
# via jupyterlab
24-
attrs==25.1.0
24+
attrs==25.3.0
2525
# via
2626
# jsonschema
2727
# referencing
@@ -236,7 +236,7 @@ notebook-shim==0.2.4
236236
# via
237237
# jupyterlab
238238
# notebook
239-
numpy==1.26.4
239+
numpy==2.0.2
240240
# via
241241
# -c requirements/base.txt
242242
# contourpy
@@ -309,14 +309,14 @@ python-dateutil==2.9.0.post0
309309
# arrow
310310
# jupyter-client
311311
# matplotlib
312-
python-json-logger==3.2.1
312+
python-json-logger==3.3.0
313313
# via jupyter-events
314314
pyyaml==6.0.2
315315
# via
316316
# -c requirements/base.txt
317317
# -c requirements/test.txt
318318
# jupyter-events
319-
pyzmq==26.2.1
319+
pyzmq==26.3.0
320320
# via
321321
# ipykernel
322322
# jupyter-client

requirements/test.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ flake8==7.1.2
4040
# flake8-docstrings
4141
flake8-docstrings==1.7.0
4242
# via -r requirements/test.in
43-
fsspec==2025.2.0
43+
fsspec==2025.3.0
4444
# via
4545
# -c requirements/base.txt
4646
# huggingface-hub
@@ -50,7 +50,7 @@ httpcore==1.0.7
5050
# via httpx
5151
httpx==0.28.1
5252
# via -r requirements/test.in
53-
huggingface-hub==0.29.2
53+
huggingface-hub==0.29.3
5454
# via
5555
# -c requirements/base.txt
5656
# -r requirements/test.in
@@ -110,7 +110,7 @@ requests==2.32.3
110110
# via
111111
# -c requirements/base.txt
112112
# huggingface-hub
113-
ruff==0.9.9
113+
ruff==0.10.0
114114
# via -r requirements/test.in
115115
sniffio==1.3.1
116116
# via anyio

test_unstructured_inference/test_elements.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_layoutelements():
4747
[0.6, 0.6, 0.65, 0.65], # One little table nested inside all the others
4848
[0.5, 0.5, 0.7, 0.7], # One nested table
4949
[0, 0, 1, 1], # Big table
50-
[0.01, 0.01, 1.01, 1.01],
50+
[0.01, 0.01, 0.09, 0.09],
5151
[0.02, 0.02, 1.02, 1.02],
5252
[0.03, 0.03, 1.03, 1.03],
5353
[0.04, 0.04, 1.04, 1.04],

unstructured_inference/__version__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.9" # pragma: no cover
1+
__version__ = "0.8.10" # pragma: no cover

unstructured_inference/models/base.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def get_default_model_mappings() -> Tuple[
2424
]:
2525
"""default model mappings for models that are in `unstructured_inference` repo"""
2626
return {
27-
**{name: UnstructuredDetectronONNXModel for name in DETECTRON2_ONNX_MODEL_TYPES},
28-
**{name: UnstructuredYoloXModel for name in YOLOX_MODEL_TYPES},
27+
**dict.fromkeys(DETECTRON2_ONNX_MODEL_TYPES, UnstructuredDetectronONNXModel),
28+
**dict.fromkeys(YOLOX_MODEL_TYPES, UnstructuredYoloXModel),
2929
}, {**DETECTRON2_ONNX_MODEL_TYPES, **YOLOX_MODEL_TYPES}
3030

3131

@@ -38,7 +38,7 @@ def register_new_model(model_config: dict, model_class: UnstructuredModel):
3838
Those maps are updated with the with the new model class information.
3939
"""
4040
model_config_map.update(model_config)
41-
model_class_map.update({name: model_class for name in model_config})
41+
model_class_map.update(dict.fromkeys(model_config, model_class))
4242

4343

4444
def get_model(model_name: Optional[str] = None) -> UnstructuredModel:

0 commit comments

Comments
 (0)