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

Hot-fix: do not share tags between ModelHubMixin siblings #2394

Merged
merged 2 commits into from
Jul 16, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Jul 16, 2024

This PR fixes a quite major issue with tags/metadata being shared between classes that inherit from PyTorchModelHubMixin. It has most likely been introduced in #2305 which was fixing attributes lost in inheritance. This time we should be fine!

I also made a modification so that tags are now deduplicated and sorted.

Realized this while working on state-spaces/mamba#471. I'll make a hot-fix release once merged as it's quite problematic. If a user has several classes inheriting from PyTorchModelHubMixin (typically several packages using it installed in a venv), then the pushed models will have incorrect metadata on the Hub. I realized this while pushing 6d4b46a.

EDIT: failing tests are unrelated

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

@julien-c
Copy link
Member

good catch

Copy link
Member

@LysandreJik LysandreJik left a comment

Choose a reason for hiding this comment

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

Oh very nice catch! Thanks for fixing @Wauplin

@Wauplin
Copy link
Contributor Author

Wauplin commented Jul 16, 2024

Thanks for the quick reviews!

@Wauplin Wauplin merged commit 05fdb76 into main Jul 16, 2024
14 of 17 checks passed
@Wauplin Wauplin deleted the hot-fix-do-not-share-tags-in-model-hub-mixin-siblings branch July 16, 2024 10:43
Wauplin added a commit that referenced this pull request Jul 16, 2024
* Hot-fix: do not share tags between ModelHubMixin sibligs

* reference regression test
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.

4 participants