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

Make HuggingFace Hub Mixin work with newer utilities #473

Merged
merged 8 commits into from
Feb 20, 2023

Conversation

Helw150
Copy link

@Helw150 Helw150 commented Jan 11, 2023

In the current master branch, this mixin fails since it's using utilities that no longer exist in Transformers itself. I've updated the Adapter HuggingFace Hub mixin to be compliant by following the update PR from the main transformers branch: https://github.com/huggingface/transformers/pull/18366/files

Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

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

Thanks a lot for looking into this!

Found one issue when testing the code (commented below).

)
if local_path is not None:
repo_path = local_path
if not repo_name.startswith(organization):
Copy link
Member

Choose a reason for hiding this comment

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

This line throws an exception for me when organization is not set.

Suggested change
if not repo_name.startswith(organization):
if organization is not None and not repo_name.startswith(organization):

Maybe we could also think about deprecating the organization parameter as done in Transformers?

Copy link
Author

Choose a reason for hiding this comment

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

I think deprecating organization to keep the AdapterHub API similar to HuggingFace makes a lot of sense! I just didn't want to change your API as a first time contributor!

Copy link
Author

Choose a reason for hiding this comment

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

For now, I've added your suggested change and kept everything backwards compatible. If you want to make this a breaking change and deprecate the organization argument, I can make that shift instead!

Copy link
Member

Choose a reason for hiding this comment

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

I think we can go for the change but keep the organization parameter for backward compatibility with a deprecation warning, similar to HF does it here: https://github.com/huggingface/transformers/blob/d1c9242db2092e9d96b1b18ba9fe27f3518184a5/src/transformers/utils/hub.py#L891-L899

Copy link
Member

Choose a reason for hiding this comment

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

Hey @Helw150, are you working on the deprecation warning implementation suggested by @calpt? We are planning to release the next AdapterHub version next week and would like to include your pull request.

Copy link
Author

Choose a reason for hiding this comment

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

Sorry - hadn't seen this notification. Just added the warning!

@calpt calpt self-requested a review February 20, 2023 13:18
Copy link
Member

@calpt calpt left a comment

Choose a reason for hiding this comment

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

Thanks again for this, looks good!

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