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

Return AdapterFusion attentions using output_adapter_fusion_attentions argument #417

Merged
merged 4 commits into from
Sep 15, 2022

Conversation

calpt
Copy link
Member

@calpt calpt commented Sep 9, 2022

Example:

model = AutoAdapterModel.from_pretrained("bert-base-uncased")
model.eval()

tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased")

model.add_adapter("a")
model.add_adapter("b")
model.add_adapter_fusion(["a", "b"])

model.active_adapters = Fuse("a", "b")

input_data = tokenizer("this is great", return_tensors="pt")

output_1 = model(**input_data, output_adapter_fusion_attentions=True)

print(output_1.adapter_fusion_attentions)

@calpt calpt marked this pull request as ready for review September 15, 2022 08:08
@calpt calpt merged commit 40e92f0 into adapter-hub:master Sep 15, 2022
@calpt calpt deleted the dev/output_adapter_fusion_attentions branch September 15, 2022 08:09
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.

1 participant