-
Notifications
You must be signed in to change notification settings - Fork 556
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
Updating HfApi objects to use dataclass #1988
Conversation
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Ahmedniz1!
Left 3 small comments to update but that's all. Then we should be able to merge 🎉
src/huggingface_hub/hf_api.py
Outdated
oid: str | ||
title: str | ||
date: datetime | ||
|
||
def __post_init__(self): # hack to make BlobLfsInfo backward compatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __post_init__(self): # hack to make BlobLfsInfo backward compatible | |
def __post_init__(self): # hack to make LastCommitInfo backward compatible |
src/huggingface_hub/hf_api.py
Outdated
safe: bool | ||
av_scan: Optional[Dict] | ||
pickle_import_scan: Optional[Dict] | ||
|
||
def __post_init__(self): # hack to make BlobLfsInfo backward compatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __post_init__(self): # hack to make BlobLfsInfo backward compatible | |
def __post_init__(self): # hack to make BlobSecurityInfo backward compatible |
src/huggingface_hub/hf_api.py
Outdated
parameters: List[Dict[str, int]] | ||
total: int | ||
|
||
def __post_init__(self): # hack to make BlobLfsInfo backward compatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __post_init__(self): # hack to make BlobLfsInfo backward compatible | |
def __post_init__(self): # hack to make SafeTensorsInfo backward compatible |
@Wauplin I've updated the comments. |
Thanks for the update @Ahmedniz1! Failing tests are unrelated so we're good to merge 🎉 Thanks again for the contribution! 🤗 |
This PR resolves issue #1911
I've updated all classes to use dataclass except (transformerinfo class).