Skip to content

Conversation

@Rocketknight1
Copy link
Member

@Rocketknight1 Rocketknight1 commented Feb 28, 2025

When you pass a PEFT adapter checkpoint to pipeline(), it actually loads the base model without the adapter. The reason is a bug in the pipeline() code, which has to look up the base model repo to get the config/architecture for the model, but accidentally totally clobbers the adapter path when it does.

Fixes #36473

@Rocketknight1
Copy link
Member Author

Ready for core maintainer review! cc @Cyrilvallez @ArthurZucker

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

@Cyrilvallez Cyrilvallez left a comment

Choose a reason for hiding this comment

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

LGTM! Indeed much better not to silently skip the adapters! 🫠

@Rocketknight1 Rocketknight1 force-pushed the pipeline-peft-interaction-fix branch from 769cdc3 to 70fb6e2 Compare March 3, 2025 16:39
@Rocketknight1 Rocketknight1 force-pushed the pipeline-peft-interaction-fix branch from 70fb6e2 to fa5696d Compare March 3, 2025 17:38
@Rocketknight1 Rocketknight1 merged commit 2aff938 into main Mar 3, 2025
24 checks passed
@Rocketknight1 Rocketknight1 deleted the pipeline-peft-interaction-fix branch March 3, 2025 18:01
garrett361 pushed a commit to garrett361/transformers that referenced this pull request Mar 4, 2025
* Fix pipeline-peft interaction

* once again you have committed a debug breakpoint

* Remove extra testing line

* Add a test to check adapter loading

* Correct adapter path

* make fixup

* Remove unnecessary check

* Make check a little more stringent
garrett361 pushed a commit to garrett361/transformers that referenced this pull request Mar 4, 2025
* Fix pipeline-peft interaction

* once again you have committed a debug breakpoint

* Remove extra testing line

* Add a test to check adapter loading

* Correct adapter path

* make fixup

* Remove unnecessary check

* Make check a little more stringent
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.

Confusing behavior when loading PEFT models with pipeline

4 participants