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
OpenDAS
Fairseq
Commits
498a186d
Commit
498a186d
authored
Jul 11, 2018
by
Stephen Roller
Committed by
Myle Ott
Jul 25, 2018
Browse files
Fix bug when --share-all-embeddings but no --encoder-embed-path
parent
1018c333
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
fairseq/models/lstm.py
fairseq/models/lstm.py
+5
-1
No files found.
fairseq/models/lstm.py
View file @
498a186d
...
...
@@ -80,10 +80,14 @@ class LSTMModel(FairseqModel):
utils
.
print_embed_overlap
(
embed_dict
,
dictionary
)
return
utils
.
load_embedding
(
embed_dict
,
dictionary
,
embed_tokens
)
pretrained_encoder_embed
=
None
if
args
.
encoder_embed_path
:
pretrained_encoder_embed
=
load_pretrained_embedding_from_file
(
args
.
encoder_embed_path
,
task
.
source_dictionary
,
args
.
encoder_embed_dim
)
else
:
num_embeddings
=
len
(
task
.
source_dictionary
)
pretrained_encoder_embed
=
Embedding
(
num_embeddings
,
args
.
encoder_embed_dim
,
task
.
source_dictionary
.
pad
()
)
if
args
.
share_all_embeddings
:
# double check all parameters combinations are valid
...
...
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