-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question on NumPy 2.x support #488
Comments
I think it could be possible. But we will have to still limit python 3.9 to <2.1.0. |
I force upgraded my environment locally to 2.x and docling seems to work with the limited cases I tested. My usual strategy is to set the requirement to the lowest version I know the lowest version of Python will work with. For example, if Docling works with NumPy 1.24.4, then you could say >= 1.24.4. The dependency manager will figure it out from there. The last version of NumPy that supports 3.9 is 2.0.2, so there should be no need to limit it to < 2.1.0 as the dependency manager won't see that version. If there is an incompatibility with a newer version, you could also limit it on the upper side too. Keeping the requirements as loose as possible helps limit these dependency loops. |
We have to update a few packages with the proper pinning, but I think it is doable. See here DS4SD/docling-ibm-models#57 |
Fantastic. This helps limit the footprint in larger environments! |
I faced some issues with numpy 2.x
|
Downgrading to 1.26.4 solved the issue.
|
I was just testing on a fresh install, and I cannot reproduce the error above. $ python3.12 -m venv venv
$ source ./venv/bin/activate
$ pip install docling
$ docling --version
Docling version: 2.8.1
Docling Core version: 2.6.1
Docling IBM Models version: 2.0.7
Docling Parse version: 2.1.2
$ pip freeze|grep numpy
numpy==2.1.3
# launch a convert
$ docling testdoc.pdf
# ...all good here @simjak can you please share a few more details? which OS? which docling version? which python version? |
@simjak which torch version did you install? $ pip freeze|grep torch
torch==2.5.1
torchvision==0.20.1 |
python 3.12, docling forked main branch, MacOS Ventura 13.0.1 |
I guess this is the newest version one can use on Intel Mac, right? So we might consider some conditional markers in that case. |
I have M1, will test with the newest with a new torch version
UV:
|
@simjak this error installing torch==2.5.1 seems odd to me, there is definitely a wheel for MacOS 11+, for python 3.12. Can you outline the changes you made on your fork? From your UV dependencies it looks like you use a pypi version of I just used |
There is nothing with this change that prevents one from limiting numpy to 1.x. It just gives the dependency manager more flexibility to work in more environments. Looking at this error:
It seems like this is a torch 2.2.2/torchvision 0.17.2 and numpy compatibility issue and nothing to do with docling. It looks like torch >=2.3 is when numpy 2.x support was added. In general, I'd suggest only worrying about Docling's dependencies and not worrying about other dependencies for those projects. For example, you wouldn't want to get into the business of managing torch dependencies here unless it's specifically a requirement for this project. If docling works with torch 2.2.2/numpy 1.x AND torch 2.5.1/numpy 2.x, that should be naturally decided by the dependency manager not hardcoded into the project deps. |
@davidmezzetti agree
|
can you try this setup:
I'm getting
|
What happens if you change to this:
|
|
@simjak I need to check again, on which platform are you? I am on a MacBook Pro M3, and macOS Sequoia 15.1.1, and all of this works fine. |
M1 13.0.1 Ventura |
Upgrading to Sequoia |
@simjak did you see any change since? |
Using <2.3.0 :) |
Closing this for now, until further issues are reported with this. |
I've found a couple discussions related to NumPy 1.x vs 2.x support (#136, #283, #420). It seems like the project is going to pin to NumPy < 2.0 for Python 3.9 - 3.12 and NumPy >= 2.0 for 3.13.
Is there something in particular causing the project to depend on NumPy 1.x for Python 3.9 - 3.12? Could the project instead support either for Python 3.9 - 3.12? Currently installing Docling on those platforms is uninstalling NumPy 2.x and downgrading to 1.x. That seems extreme unless there is something specifically not supported.
The text was updated successfully, but these errors were encountered: