Provide extra arguments required for tasks.
(parser)
| 25 | |
| 26 | |
| 27 | def get_tasks_args(parser): |
| 28 | """Provide extra arguments required for tasks.""" |
| 29 | group = parser.add_argument_group(title='tasks') |
| 30 | |
| 31 | group.add_argument('--task', type=str, required=True, |
| 32 | help='Task name.') |
| 33 | group.add_argument('--epochs', type=int, default=None, |
| 34 | help='Number of finetunning epochs. Zero results in ' |
| 35 | 'evaluation only.') |
| 36 | group.add_argument('--pretrained-checkpoint', type=str, default=None, |
| 37 | help='Pretrained checkpoint used for finetunning.') |
| 38 | group.add_argument('--keep-last', action='store_true', |
| 39 | help='Keep the last batch (maybe incomplete) in' |
| 40 | 'the data loader') |
| 41 | group.add_argument('--train-data', nargs='+', default=None, |
| 42 | help='Whitespace separated paths or corpora names ' |
| 43 | 'for training.') |
| 44 | group.add_argument('--valid-data', nargs='*', default=None, |
| 45 | help='path(s) to the validation data.') |
| 46 | group.add_argument('--overlapping-eval', type=int, default=32, |
| 47 | help='Sliding window for overlapping evaluation.') |
| 48 | group.add_argument('--strict-lambada', action='store_true', |
| 49 | help='Use more difficult formulation of lambada.') |
| 50 | |
| 51 | return parser |
| 52 | |
| 53 | |
| 54 | if __name__ == '__main__': |
nothing calls this directly
no outgoing calls
no test coverage detected