(parser)
| 62 | |
| 63 | |
| 64 | def get_patch_args(parser): |
| 65 | group = parser.add_argument_group(title='patch') |
| 66 | |
| 67 | for action in vars(group)['_actions']: |
| 68 | if isinstance(action, argparse._StoreAction): |
| 69 | if '--tokenizer-type' in action.option_strings: |
| 70 | action.default = "NullTokenizer" |
| 71 | |
| 72 | for action in vars(group)['_actions']: |
| 73 | if isinstance(action, argparse._StoreAction): |
| 74 | if '--vocab-size' in action.option_strings: |
| 75 | action.default = -1 |
| 76 | |
| 77 | for action in vars(group)['_actions']: |
| 78 | if isinstance(action, argparse._StoreAction): |
| 79 | if '--position-embedding-type' in action.option_strings: |
| 80 | action.choices.append('none') |
| 81 | |
| 82 | group.add_argument('--local-rank', |
| 83 | type=int, |
| 84 | default=None, |
| 85 | help='local rank passed from distributed launcher') |
| 86 | |
| 87 | group.add_argument('--n-head-kv', |
| 88 | type=int, |
| 89 | default=None, |
| 90 | help='n-head-kv') |
| 91 | |
| 92 | group.add_argument('--transformer-type', |
| 93 | type=str, |
| 94 | default='megatron', |
| 95 | help='transformer-type') |
| 96 | |
| 97 | group.add_argument('--max-padding-length', |
| 98 | type=int, |
| 99 | default=None, |
| 100 | help='max-padding-length') |
| 101 | |
| 102 | group.add_argument('--dataset', |
| 103 | type=str, |
| 104 | default=None, |
| 105 | help='dataset') |
| 106 | |
| 107 | group.add_argument('--epochs', |
| 108 | type=int, |
| 109 | default=None, |
| 110 | help='Number of finetunning epochs. Zero results in ' |
| 111 | 'evaluation only.') |
| 112 | |
| 113 | group.add_argument('--intermediate-size', |
| 114 | type=int, |
| 115 | default=None, |
| 116 | help='--intermediate-size') |
| 117 | |
| 118 | group.add_argument('--extra-vocab-size', |
| 119 | type=int, |
| 120 | default=0, |
| 121 | help='--extra-vocab-size') |
no outgoing calls
no test coverage detected