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
3ae97589
Unverified
Commit
3ae97589
authored
May 21, 2018
by
Myle Ott
Committed by
GitHub
May 21, 2018
Browse files
Fix old model checkpoints after #151 (fixes #156) (#157)
parent
4973d05a
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 @
3ae97589
...
...
@@ -57,6 +57,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 @
3ae97589
...
...
@@ -56,6 +56,10 @@ class LSTMModel(FairseqModel):
@
classmethod
def
build_model
(
cls
,
args
,
src_dict
,
dst_dict
):
"""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