Unverified Commit 3ae97589 authored by Myle Ott's avatar Myle Ott Committed by GitHub
Browse files

Fix old model checkpoints after #151 (fixes #156) (#157)

parent 4973d05a
...@@ -57,6 +57,10 @@ class FConvModel(FairseqModel): ...@@ -57,6 +57,10 @@ class FConvModel(FairseqModel):
args.max_target_positions = args.max_positions args.max_target_positions = args.max_positions
if not hasattr(args, 'share_input_output_embed'): if not hasattr(args, 'share_input_output_embed'):
args.share_input_output_embed = False 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 encoder_embed_dict = None
if args.encoder_embed_path: if args.encoder_embed_path:
......
...@@ -56,6 +56,10 @@ class LSTMModel(FairseqModel): ...@@ -56,6 +56,10 @@ class LSTMModel(FairseqModel):
@classmethod @classmethod
def build_model(cls, args, src_dict, dst_dict): def build_model(cls, args, src_dict, dst_dict):
"""Build a new model instance.""" """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 encoder_embed_dict = None
if args.encoder_embed_path: if args.encoder_embed_path:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment