8000 FIX Type annoations in vera/bnb.py by BenjaminBossan · Pull Request #2139 · huggingface/peft · GitHub
[go: up one dir, main page]

Skip to content

FIX Type annoations in vera/bnb.py #2139

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

Merged

Conversation

BenjaminBossan
Copy link
Member

The file was missing the from __future__ import annotations part. As this code is only running nightly with GPU, the normal CI missed this omission. With this PR, nightly CI should be green again.

When I tested it locally with GPU, I didn't check with Python 3.8, so this error did not occur. Once we stop supporting Python 3.8 very soon, this will also no longer be necessary, but we still need to fix it until then.

The file was missing the from __future__ import annotations part. As
this code is only running nightly with GPU, the normal CI missed this
omission.
@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Copy link
Member
@sayakpaul sayakpaul left a comment

Choose a reason for hiding this comment

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

TIL! How does this affect?

@BenjaminBossan
Copy link
Member Author

TIL! How does this affect?

When you have code like:

def foo(x: list[str]):
    pass

This normally requires Python 3.9+ or you need to use from typing import List and use List[str]. However, with the __future__ import, you can use the type annotation syntax from Python 3.9+ inside of Python 3.8.

@sayakpaul
Copy link
Member

Thanks for clarifying!

@sayakpaul sayakpaul merged commit 3b314cc into huggingface:main Oct 9, 2024
14 checks passed
@BenjaminBossan BenjaminBossan deleted the fix-annotations-vera-bnb branch October 9, 2024 10:24
BenjaminBossan added a commit to BenjaminBossan/peft that referenced this pull request Oct 22, 2024
The file was missing the from __future__ import annotations part. As
this code is only running nightly with GPU, the normal CI missed this
omission.
Guy-Bilitski pushed a commit to Guy-Bilitski/peft that referenced this pull request May 13, 2025
The file was missing the from __future__ import annotations part. As
this code is only running nightly with GPU, the normal CI missed this
omission.
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
0