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

Unpin numba #23162

Merged
merged 16 commits into from
May 31, 2023
Merged

Unpin numba #23162

merged 16 commits into from
May 31, 2023

Conversation

sanchit-gandhi
Copy link
Contributor

@sanchit-gandhi sanchit-gandhi commented May 5, 2023

What does this PR do?

Numba was pinned to <0.57.0 in #23118 - this is because it forced an update of the numpy package to >= 1.24. From numpy >= 1.24, converting a ragged list to a numpy array requires the user to explicitly set dtype=object (before this happened automatically, but threw a deprecation warning).

This PR updates the feature extraction and tokenisation utils to explicitly specify dtype=object when converting ragged lists to numpy arrays.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 5, 2023

The documentation is not available anymore as the PR was closed or merged.

@sanchit-gandhi sanchit-gandhi force-pushed the bump-numpy-version branch 2 times, most recently from 13ff157 to a066590 Compare May 11, 2023 16:41
@sanchit-gandhi
Copy link
Contributor Author

Failing test is unrelated (tf compile test)

@sanchit-gandhi sanchit-gandhi requested a review from sgugger May 22, 2023 16:54
@@ -116,7 +116,7 @@ def test_retrieve(self):
retriever = self.get_dummy_retriever()
tokenizer = retriever.tokenizer

retrieved_block_ids = np.array([0, 3], dtype=np.long)
retrieved_block_ids = np.array([0, 3], dtype="long")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np.long is also deprecated in favour of dtype="long"

Copy link
Collaborator

@sgugger sgugger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@sanchit-gandhi sanchit-gandhi merged commit 8f915c4 into huggingface:main May 31, 2023
sheonhan pushed a commit to sheonhan/transformers that referenced this pull request Jun 1, 2023
* fix for ragged list

* unpin numba

* make style

* np.object -> object

* propagate changes to tokenizer as well

* np.long -> "long"

* revert tokenization changes

* check with tokenization changes

* list/tuple logic

* catch numpy

* catch else case

* clean up

* up

* better check

* trigger ci

* Empty commit to trigger CI
gojiteji pushed a commit to gojiteji/transformers that referenced this pull request Jun 5, 2023
* fix for ragged list

* unpin numba

* make style

* np.object -> object

* propagate changes to tokenizer as well

* np.long -> "long"

* revert tokenization changes

* check with tokenization changes

* list/tuple logic

* catch numpy

* catch else case

* clean up

* up

* better check

* trigger ci

* Empty commit to trigger CI
novice03 pushed a commit to novice03/transformers that referenced this pull request Jun 23, 2023
* fix for ragged list

* unpin numba

* make style

* np.object -> object

* propagate changes to tokenizer as well

* np.long -> "long"

* revert tokenization changes

* check with tokenization changes

* list/tuple logic

* catch numpy

* catch else case

* clean up

* up

* better check

* trigger ci

* Empty commit to trigger CI
@sanchit-gandhi sanchit-gandhi deleted the bump-numpy-version branch June 25, 2023 09:54
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.

3 participants