Skip to content

Can I add a composition Block of different adapter types? #688

Answered by lenglaender
MRawhani asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @MRawhani
Are you using the current library version? AFAIK we fixed something related to Stack some time ago. I couldn't replicate your problems with this:

import adapters

model = adapters.AutoAdapterModel.from_pretrained("google-bert/bert-base-uncased")
model.add_adapter("a",config="seq_bn")
model.add_adapter("b",config="lora")
model.add_classification_head("b", num_labels=3)
model.active_adapters = adapters.composition.Stack("a", "b")

This throws no error, and the adapter summary looks like this:

>>> print(model.adapter_summary())
================================================================================
Name                     Architecture         #Param      %Param  Active …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MRawhani
Comment options

Answer selected by calpt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants