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
9e9f6b8a
Unverified
Commit
9e9f6b8a
authored
Mar 14, 2022
by
tiedemann
Committed by
GitHub
Mar 14, 2022
Browse files
Update convert_marian_to_pytorch.py (#16124)
Configuration `tied-embeddings-all` implies `tied-embeddings-src`
parent
2de99e6c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
src/transformers/models/marian/convert_marian_to_pytorch.py
src/transformers/models/marian/convert_marian_to_pytorch.py
+2
-0
No files found.
src/transformers/models/marian/convert_marian_to_pytorch.py
View file @
9e9f6b8a
...
@@ -480,6 +480,8 @@ class OpusState:
...
@@ -480,6 +480,8 @@ class OpusState:
if
"Wpos"
in
self
.
state_dict
:
if
"Wpos"
in
self
.
state_dict
:
raise
ValueError
(
"Wpos key in state dictionary"
)
raise
ValueError
(
"Wpos key in state dictionary"
)
self
.
state_dict
=
dict
(
self
.
state_dict
)
self
.
state_dict
=
dict
(
self
.
state_dict
)
if
cfg
[
"tied-embeddings-all"
]:
cfg
[
"tied-embeddings-src"
]
=
True
self
.
share_encoder_decoder_embeddings
=
cfg
[
"tied-embeddings-src"
]
self
.
share_encoder_decoder_embeddings
=
cfg
[
"tied-embeddings-src"
]
# create the tokenizer here because we need to know the eos_token_id
# create the tokenizer here because we need to know the eos_token_id
...
...
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