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
1f728657
Unverified
Commit
1f728657
authored
Mar 30, 2020
by
dougian
Committed by
GitHub
Mar 30, 2020
Browse files
[BART] Update encoder and decoder on set_input_embedding (#3501)
Co-authored-by:
Ioannis Douratsos
<
ioannisd@amazon.com
>
parent
cc598b31
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/modeling_bart.py
src/transformers/modeling_bart.py
+2
-0
No files found.
src/transformers/modeling_bart.py
View file @
1f728657
...
...
@@ -805,6 +805,8 @@ class BartModel(PretrainedBartModel):
def
set_input_embeddings
(
self
,
value
):
self
.
shared
=
value
self
.
encoder
.
embed_tokens
=
self
.
shared
self
.
decoder
.
embed_tokens
=
self
.
shared
def
get_output_embeddings
(
self
):
return
_make_linear_from_emb
(
self
.
shared
)
# make it on the fly
...
...
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