Skip to content

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

Merged
younesbelkada merged 4 commits into
huggingface:mainfrom
glerzing:peft_loading
May 31, 2023
Merged

younesbelkada merged 4 commits into
huggingface:mainfrom
glerzing:peft_loading

Conversation

@glerzing

Copy link
Copy Markdown
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

HuggingFaceDocBuilderDev commented May 20, 2023 •

Copy link
Copy Markdown

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

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

@younesbelkada younesbelkada left a comment

Copy link
Copy Markdown
Contributor

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

@younesbelkada
younesbelkada requested a review from lvwerra May 25, 2023 10:24

@lvwerra lvwerra left a comment

Copy link
Copy Markdown
Member

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
yxliu-TAMU pushed a commit to mincheolseong/ECEN743-GRPO-Project-Proposal that referenced this pull request Apr 20, 2025
* from_pretrain with peft adapter on the hub (# 379)

* Update the comment

* PR comment
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