-
Notifications
You must be signed in to change notification settings - Fork 356
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
Rename AdapterConfigBase to AdapterConfig #601
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refactoring the modeling classes so that they inherit from HuggingFace classes Renaming our classes to ...WithAdapters
Refactored ALBERT
Co-authored-by: calpt <[email protected]>
Co-authored-by: calpt <[email protected]>
Co-authored-by: Leon Engländer <[email protected]>
Co-authored-by: calpt <[email protected]>
Co-authored-by: calpt <[email protected]>
add remove test inv_adapters
This PR removes all XModelWithHeads classes and updates the notebooks that have used these classes.
This PR updates the documentation to the new version for the sections: - Adapter Activation and Composition - Prediction Heads - Embeddings --------- Co-authored-by: Hannah Sterz <[email protected]>
…apter-hub#41) Changed the following documentation pages: - Adding Adapters to a Model - Extending the Library - Model Mixins --------- Co-authored-by: TimoImhof <[email protected]>
This PR adjusts all example scripts so that they work again. I deleted all Hugging Face scripts that we hadn't customized yet. --------- Co-authored-by: TimoImhof <[email protected]>
This PR updates the example notebooks to the adapters package.
Upgrade notes: - remove copying of model classes for GPT-2 and GPT-J due to changes to Transformers merged in huggingface/transformers#25188. - Add extra argument to `_resize_token_embeddings()` - Add sequence classification head to T5 & use it in adapter tests - Fix test config of Llama
Refactors the implementation of composition blocks in the model forward pass such that more of the logic is shared between all adapter methods. ### Changes - Move adapter methods into new `methods` folder - Introduce new `ComposableAdapterLayerBase` as subclass of `AdapterLayerbase` as shared base class of all adapter methods that support composition. - This class provides default implementations for a couple of composition blocks (currently `Stack`, `Parallel`, `BatchSplit`, `Average`) which can be used by all subclasses. - To enable these composition blocks for deriving methods, a couple of helper methods defined in `ComposableAdapterLayerBase` must be implemented. See https://github.com/calpt/adapter-transformers/blob/55fdc0cbe2f695914108a9c0e208127b13bc617e/src/adapters/methods/adapter_layer_base.py#L132-L222. - Different adapter methods require passing different inputs to each composition block. Thus, the input states are abstracted as a `NamedTuple` in the base class. Deriving classes should define concrete `NamedTuple`-derived state classes. E.g., see https://github.com/calpt/adapter-transformers/blob/55fdc0cbe2f695914108a9c0e208127b13bc617e/src/adapters/methods/bottleneck.py#L22 - Update `Split` composition block to support more than two child blocks. Splits are defined as a list of split indices, ie. `Split("a", "b", "c", splits=[64, 64, 64])`. **Breaking change** - Renamings: `AdapterLayer` -> `BottleneckLayer`; `PrefixTuningShim` -> `PrefixTuningLayer` --------- Co-authored-by: Leon Engländer <[email protected]>
calpt
approved these changes
Nov 14, 2023
docs/transitioning.md
Outdated
@@ -50,6 +50,12 @@ The `adapters` library supports the configuration of adapters using [config stri | |||
For a complete list of config strings and classes see [here](https://docs.adapterhub.ml/overview.html). We strongly recommend using the new config strings, but we will continue to support the old config strings for the time being to make the transition easier. | |||
Note that with the config strings the coresponding adapter config classes have changed, e.g. `PfeifferConfig` -> `SeqBnConfig`. | |||
|
|||
An other consequence of this that the `AdapterConfig` class is now not only for the bottleneck adapters anymore, but the base class of all the configurations (previously `AdapterConfigBase`). Hence the function this class serves has changed. However, you can still load adapter configs with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested change
An other consequence of this that the `AdapterConfig` class is now not only for the bottleneck adapters anymore, but the base class of all the configurations (previously `AdapterConfigBase`). Hence the function this class serves has changed. However, you can still load adapter configs with: | |
Another consequence of this that the `AdapterConfig` class is now not only for the bottleneck adapters anymore, but the base class of all the configurations (previously `AdapterConfigBase`). Hence the function this class serves has changed. However, you can still load adapter configs with: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.