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

Add adapter support to CLIP #483

Merged
merged 8 commits into from
Feb 2, 2023
Merged

Add adapter support to CLIP #483

merged 8 commits into from
Feb 2, 2023

Conversation

calpt
Copy link
Member

@calpt calpt commented Jan 21, 2023

Closes #296. This PR includes the following changes:

  • Integration of all adapter methods into CLIPModel, CLIPTextModel & CLIPVisionModel classes.
  • Modify prefix tuning implementation to support different values for n_heads & input_size at different locations: This is required for CLIP text & vision encoder prefixes to be stored in the same PT pool.
  • Introduction of InvertibleAdaptersWrapperMixin for model classes that support invertible adapters in a sub-module.

Install with:

pip install git+https://github.com/calpt/adapter-transformers.git@dev/clip

Tested the implementation for our current project.

@calpt calpt marked this pull request as ready for review February 2, 2023 11:17
@calpt calpt merged commit 2af89bd into adapter-hub:master Feb 2, 2023
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.

New model: CLIP
2 participants