Skip to content
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

Add compatibility for numpy 2 while preserving numpy 1 compatibility #1265

Merged
merged 1 commit into from
Nov 27, 2024

Conversation

neilmehta24
Copy link
Contributor

Check the numpy major version number before deciding which file to import methods from.

I have not benchmarked numpy 1 vs numpy 2 performance for outlines, but I have verified that outlines works as intended when using numpy 2 for the examples in the README.

Closes #1104

@ur4t
Copy link

ur4t commented Nov 24, 2024

@rlouf Could you please review and merge this PR? Torch has moved to Numpy 2.0 for quite a long time and there might be potential breakages to downgrade Numpy.

@rlouf
Copy link
Member

rlouf commented Nov 27, 2024

Sure, will merge if CI is green.

@neilmehta24
Copy link
Contributor Author

=========================== short test summary info ============================
ERROR tests/generate/test_integration_transformers_vision.py::test_single_image_text_gen - OSError: trl-internal-testing/tiny-random-LlavaForConditionalGeneration is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`
ERROR tests/generate/test_integration_transformers_vision.py::test_multi_image_text_gen - OSError: trl-internal-testing/tiny-random-LlavaForConditionalGeneration is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`
ERROR tests/generate/test_integration_transformers_vision.py::test_mismatched_image_text_gen - OSError: trl-internal-testing/tiny-random-LlavaForConditionalGeneration is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`
ERROR tests/generate/test_integration_transformers_vision.py::test_single_image_choice - OSError: trl-internal-testing/tiny-random-LlavaForConditionalGeneration is not a local folder and is not a valid model identifier listed on 'https://huggingface.co/models'
If this is a private repository, make sure to pass a token having permission to this repo either by logging in with `huggingface-cli login` or by passing `token=<your_token>`
= 478 passed, 232 skipped, 1 xfailed, 2 xpassed, 4 errors in 720.44s (0:12:00) =

🤔
Will dig deeper into this failure later this week. On the face of it, doesn't seem related to the numpy change

@rlouf
Copy link
Member

rlouf commented Nov 27, 2024

It's completely unrelated so I'll go ahead and merge. Thank you for the contribution!

@rlouf rlouf merged commit 63b4feb into dottxt-ai:main Nov 27, 2024
5 of 6 checks passed
@neilmehta24 neilmehta24 deleted the neil/numpy-version branch December 17, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Numpy > 1.26.4
3 participants