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

from_pretrain with peft adapter on the hub (# 379) #380

Merged
merged 4 commits into from
May 31, 2023

Conversation

glerzing
Copy link
Contributor

I also added a warning in case an adapter is found but a peft_config is also given. And I tried to simplify a bit since the same processing is done in PeftConfig.from_pretrained.

is_peft_available() is indirectly checked. If it is not installed, it will trigger an exception and trained_adapter_config will be set to None.

Let me know what you think. If you don't think this is an improvement, I can revert, no problem.

@HuggingFaceDocBuilderDev
Copy link

HuggingFaceDocBuilderDev commented May 20, 2023

The documentation is not available anymore as the PR was closed or merged.

Copy link
Collaborator

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thank you very much for this!
I have one comment, I am not really comfortable using try/except directly on the PeftConfig.from_pretrained call as this might catch a lot of exceptions that we don't want to catch. How about using hf_hub_download as it was done before?

@glerzing
Copy link
Contributor Author

I just pushed a new version. I also added a few logging.info(). Let me know if that's a bad idea, I can revert that too.

Copy link
Collaborator

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

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

Thanks very much! This looks good to me

Copy link
Member

@lvwerra lvwerra left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for adding!

@younesbelkada younesbelkada merged commit e174bd5 into huggingface:main May 31, 2023
11 of 12 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

4 participants