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
d4816034
Commit
d4816034
authored
May 21, 2018
by
Myle Ott
Browse files
Fix old model checkpoints
parent
81e99d8d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
fairseq/models/fconv.py
fairseq/models/fconv.py
+4
-0
fairseq/models/lstm.py
fairseq/models/lstm.py
+4
-0
No files found.
fairseq/models/fconv.py
View file @
d4816034
...
...
@@ -60,6 +60,10 @@ class FConvModel(FairseqModel):
args
.
max_target_positions
=
args
.
max_positions
if
not
hasattr
(
args
,
'share_input_output_embed'
):
args
.
share_input_output_embed
=
False
if
not
hasattr
(
args
,
'encoder_embed_path'
):
args
.
encoder_embed_path
=
None
if
not
hasattr
(
args
,
'decoder_embed_path'
):
args
.
decoder_embed_path
=
None
encoder_embed_dict
=
None
if
args
.
encoder_embed_path
:
...
...
fairseq/models/lstm.py
View file @
d4816034
...
...
@@ -61,6 +61,10 @@ class LSTMModel(FairseqModel):
base_architecture
(
args
)
"""Build a new model instance."""
if
not
hasattr
(
args
,
'encoder_embed_path'
):
args
.
encoder_embed_path
=
None
if
not
hasattr
(
args
,
'decoder_embed_path'
):
args
.
decoder_embed_path
=
None
encoder_embed_dict
=
None
if
args
.
encoder_embed_path
:
...
...
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