Fairseq: Sub-parser for better help message in command-line tool

Created on 24 Jun 2020  路  1Comment  路  Source: pytorch/fairseq

馃殌 Feature Request

Commands like fairseq-train currently does not display the full list of options.
This can be improved upon by using sub-parsers.

Motivation

By refactoring the codebase with sub-parsers, we can

  • Improve the self-documentation of fairseq-cli though command-line help messages.
  • Remove the need for hacky and overly complicated functions like parse_args_and_arch.

Pitch

Convert arguments like --arch to use sub-parsers instead.
There are other examples like --criterion etc.

Alternatives

Alternatively, we can stick with the current code-style.
But personally, I think the current level of smell is sufficient to warrant a refactor.
The smellier it gets, the more effort will be needed in the future.

Additional context

I'm a willing contributor! I work as a software engineer on our machine translation experimentation platform at work.

enhancement help wanted

Most helpful comment

Yes, I completely agree. We have an active effort to migrate away from argparse to instead use dataclasses and hydra. We hope to share more details soon.

cc @kevinmtian @alexeib

>All comments

Yes, I completely agree. We have an active effort to migrate away from argparse to instead use dataclasses and hydra. We hope to share more details soon.

cc @kevinmtian @alexeib

Was this page helpful?
0 / 5 - 0 ratings