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

Updating HfApi objects to use dataclass #1988

Merged
merged 3 commits into from
Jan 18, 2024

Conversation

Ahmedniz1
Copy link
Contributor

This PR resolves issue #1911
I've updated all classes to use dataclass except (transformerinfo class).

@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
Contributor

@Wauplin Wauplin left a 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 🎉

oid: str
title: str
date: datetime

def __post_init__(self): # hack to make BlobLfsInfo backward compatible
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def __post_init__(self): # hack to make BlobLfsInfo backward compatible
def __post_init__(self): # hack to make LastCommitInfo backward compatible

safe: bool
av_scan: Optional[Dict]
pickle_import_scan: Optional[Dict]

def __post_init__(self): # hack to make BlobLfsInfo backward compatible
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def __post_init__(self): # hack to make BlobLfsInfo backward compatible
def __post_init__(self): # hack to make BlobSecurityInfo backward compatible

parameters: List[Dict[str, int]]
total: int

def __post_init__(self): # hack to make BlobLfsInfo backward compatible
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def __post_init__(self): # hack to make BlobLfsInfo backward compatible
def __post_init__(self): # hack to make SafeTensorsInfo backward compatible

@Ahmedniz1
Copy link
Contributor Author

@Wauplin I've updated the comments.
Thanks

@Wauplin
Copy link
Contributor

Wauplin commented Jan 18, 2024

Thanks for the update @Ahmedniz1! Failing tests are unrelated so we're good to merge 🎉 Thanks again for the contribution! 🤗

@Wauplin Wauplin merged commit a53de81 into huggingface:main Jan 18, 2024
13 of 14 checks passed
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.

None yet

3 participants