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

Backport: Fix activation lookup with Python 3.12.3 (#375) #377

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

danieldk
Copy link
Contributor

Description

We used the metaclass EnumMeta/EnumType to override reporting of missing enum values (to give the full set of supported activations). However, in Python 3.12.3, the default value of the name parameter of EnumType.__call__ method was changed from None to _not_given:

python/cpython@d771729

Even though this is a public API (which now uses a private default value), it seems too risky to continue using it. So in this change, we implement Enum.__mising__ instead for the improved error reporting.

Checklist

  • I confirm that I have the right to submit this contribution under the project's MIT license.

We used the metaclass `EnumMeta`/`EnumType` to override reporting of
missing enum values (to give the full set of supported activations).
However, in Python 3.12.3, the default value of the `name` parameter of
`EnumType.__call__` method was changed from `None` to `_not_given`:

python/cpython@d771729

Even though this is a public API (which now uses a private default
value), it seems too risky to continue using it. So in this change, we
implement `Enum.__mising__` instead for the improved error reporting.
@danieldk danieldk added type/bug Type: Bug type/maintenance Type: Maintenance backport Bugfix backport PR labels Apr 17, 2024
* Fix `test_rotary_embeddings_against_hf` for latest transformers

* xfail test because HfFileSystem is currently broken
@danieldk danieldk merged commit 3e6180f into explosion:v1.3.x Apr 17, 2024
7 of 8 checks passed
@danieldk danieldk deleted the backport/activation-lookup branch April 17, 2024 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Bugfix backport PR type/bug Type: Bug type/maintenance Type: Maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant