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
3e1cd824
"...git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "cf3cf304ca234ce70ffa223d7868e63133acd7ec"
Commit
3e1cd824
authored
Oct 10, 2019
by
Rémi Louf
Browse files
fix stupid (re)naming issue
parent
81ee29ee
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
transformers/modeling_bert.py
transformers/modeling_bert.py
+3
-3
No files found.
transformers/modeling_bert.py
View file @
3e1cd824
...
@@ -333,12 +333,12 @@ class BertLayer(nn.Module):
...
@@ -333,12 +333,12 @@ class BertLayer(nn.Module):
if
encoder_hidden_state
:
if
encoder_hidden_state
:
try
:
try
:
cross
attention_outputs
=
self
.
crossattention
(
attention_output
,
attention_mask
,
head_mask
,
encoder_hidden_state
)
attention_outputs
=
self
.
crossattention
(
attention_output
,
attention_mask
,
head_mask
,
encoder_hidden_state
)
except
AttributeError
as
ae
:
except
AttributeError
as
ae
:
raise
ae
(
"you need to set `is_encoder` to True in the configuration to instantiate an encoder layer"
)
raise
ae
(
"you need to set `is_encoder` to True in the configuration to instantiate an encoder layer"
)
cross
attention_output
=
cross
attention_outputs
[
0
]
attention_output
=
attention_outputs
[
0
]
intermediate_output
=
self
.
intermediate
(
cross
attention_output
)
intermediate_output
=
self
.
intermediate
(
attention_output
)
layer_output
=
self
.
output
(
intermediate_output
,
attention_output
)
layer_output
=
self
.
output
(
intermediate_output
,
attention_output
)
outputs
=
(
layer_output
,)
+
attention_outputs
[
1
:]
# add attentions if we output them
outputs
=
(
layer_output
,)
+
attention_outputs
[
1
:]
# add attentions if we output them
return
outputs
return
outputs
...
...
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