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

How do I output the attention from the model? #80

Open
jkb-ag opened this issue Apr 5, 2024 · 1 comment
Open

How do I output the attention from the model? #80

jkb-ag opened this issue Apr 5, 2024 · 1 comment

Comments

@jkb-ag
Copy link

jkb-ag commented Apr 5, 2024

Hi,
When running dnabert2, I'm trying to output not only the CLS and hidden states but also the attentions.

I tried:

`db2_model = AutoModel.from_pretrained(dirname, output_attentions=True, trust_remote_code=True)

output = db2_model(input_ids)
`

but the output is only a tuple of length 2 (the hidden states and the CLS tensor).

Any help would be much appreciated!

Thanks!

@ZoeyXiang1202
Copy link

Hi,

I also have the same question. Could you please show where the finetuned model weight is saved?

Thanks a lot!

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

No branches or pull requests

3 participants
@jkb-ag @ZoeyXiang1202 and others