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
"vscode:/vscode.git/clone" did not exist on "a34d97cef08f25685ebe165693c2511ad9ef8af1"
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
Show 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):
...
@@ -80,10 +80,14 @@ class LSTMModel(FairseqModel):
utils
.
print_embed_overlap
(
embed_dict
,
dictionary
)
utils
.
print_embed_overlap
(
embed_dict
,
dictionary
)
return
utils
.
load_embedding
(
embed_dict
,
dictionary
,
embed_tokens
)
return
utils
.
load_embedding
(
embed_dict
,
dictionary
,
embed_tokens
)
pretrained_encoder_embed
=
None
if
args
.
encoder_embed_path
:
if
args
.
encoder_embed_path
:
pretrained_encoder_embed
=
load_pretrained_embedding_from_file
(
pretrained_encoder_embed
=
load_pretrained_embedding_from_file
(
args
.
encoder_embed_path
,
task
.
source_dictionary
,
args
.
encoder_embed_dim
)
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
:
if
args
.
share_all_embeddings
:
# double check all parameters combinations are valid
# 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