Skip to content

Commit

Permalink
Remove required from --arch (facebookresearch#993)
Browse files Browse the repository at this point in the history
Summary:
As per fairinternal/fairseq-py#983, we find that you cannot just modify the defaults of arch because it will still "require" you to input something on the command line. I'm not sure why this is required where task, criterion, etc (and actually, anything else) are not. Additionally, the [argparse docs](https://docs.python.org/3/library/argparse.html#required) claim that required=True is bad form so should be avoided.
Pull Request resolved: fairinternal/fairseq-py#993

Differential Revision: D19446805

Pulled By: myleott

fbshipit-source-id: 53221bb8bc1cea66197c5cee48a307b88d0d20b7
  • Loading branch information
ebetica authored and facebook-github-bot committed Jan 17, 2020
1 parent 468115c commit 441d817
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fairseq/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def add_model_args(parser):
# 2) --arch argument
# 3) --encoder/decoder-* arguments (highest priority)
from fairseq.models import ARCH_MODEL_REGISTRY
group.add_argument('--arch', '-a', default='fconv', metavar='ARCH', required=True,
group.add_argument('--arch', '-a', default='fconv', metavar='ARCH',
choices=ARCH_MODEL_REGISTRY.keys(),
help='Model Architecture')
# fmt: on
Expand Down

0 comments on commit 441d817

Please sign in to comment.