def add_cmdline_args(parser): """Add CLI args.""" TorchClassifierAgent.add_cmdline_args(parser) parser = parser.add_argument_group('BERT Classifier Arguments') parser.add_argument( '--type-optimization', type=str, default='all_encoder_layers', choices=[ 'additional_layers', 'top_layer', 'top4_layers', 'all_encoder_layers', 'all', ], help='which part of the encoders do we optimize ' '(defaults to all layers)', ) parser.add_argument( '--add-cls-token', type='bool', default=True, help='add [CLS] token to text vec', ) parser.add_argument( '--sep-last-utt', type='bool', default=False, help='separate the last utterance into a different' 'segment with [SEP] token in between', ) parser.set_defaults(dict_maxexs=0) # skip building dictionary
def add_cmdline_args(parser): TransformerRankerAgent.add_cmdline_args(parser) # add transformer args TorchClassifierAgent.add_cmdline_args(parser) parser.add_argument( '--load-from-pretrained-ranker', type='bool', default=False, help='load model from base transformer ranking model ' '(used for pretraining)', ) parser.set_params(reduction_type='first')
def add_cmdline_args(parser): TorchClassifierAgent.add_cmdline_args(parser) parser = parser.add_argument_group('BERT Classifier Arguments') parser.add_argument('--bert-id', type=str, default='bert-base-uncased') parser.add_argument('--type-optimization', type=str, default='all_encoder_layers', choices=[ 'additional_layers', 'top_layer', 'top4_layers', 'all_encoder_layers', 'all' ], help='which part of the encoders do we optimize ' '(defaults to all layers)')
def add_cmdline_args(parser): TorchClassifierAgent.add_cmdline_args(parser) parser = parser.add_argument_group('BERT Classifier Arguments') parser.add_argument('--type-optimization', type=str, default='all_encoder_layers', choices=[ 'additional_layers', 'top_layer', 'top4_layers', 'all_encoder_layers', 'all' ], help='which part of the encoders do we optimize ' '(defaults to all layers)') parser.set_defaults( dict_maxexs=0, # skip building dictionary )