Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
b3544e4c
"docs/source/vscode:/vscode.git/clone" did not exist on "1c37e8c1a6274e6e87b45c6319eb190757214c2a"
Unverified
Commit
b3544e4c
authored
Mar 29, 2021
by
Guillaume Filion
Committed by
GitHub
Mar 29, 2021
Browse files
Return global attentions (see #7514) (#10906)
parent
4f21e1dd
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/models/longformer/modeling_longformer.py
src/transformers/models/longformer/modeling_longformer.py
+3
-0
No files found.
src/transformers/models/longformer/modeling_longformer.py
View file @
b3544e4c
...
...
@@ -1786,6 +1786,7 @@ class LongformerForMaskedLM(LongformerPreTrainedModel):
logits
=
prediction_scores
,
hidden_states
=
outputs
.
hidden_states
,
attentions
=
outputs
.
attentions
,
global_attentions
=
outputs
.
global_attentions
,
)
...
...
@@ -1878,6 +1879,7 @@ class LongformerForSequenceClassification(LongformerPreTrainedModel):
logits
=
logits
,
hidden_states
=
outputs
.
hidden_states
,
attentions
=
outputs
.
attentions
,
global_attentions
=
outputs
.
global_attentions
,
)
...
...
@@ -2126,6 +2128,7 @@ class LongformerForTokenClassification(LongformerPreTrainedModel):
logits
=
logits
,
hidden_states
=
outputs
.
hidden_states
,
attentions
=
outputs
.
attentions
,
global_attentions
=
outputs
.
global_attentions
,
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment