Example #8 0 Show file File: train.py Project: gitabtion/pycorrector def main(): cfg = args_parse() # 如果不存在训练文件则先处理数据 if not os.path.exists(cfg.DATASETS.TRAIN): logger.debug('preprocess data') preprocess.main() logger.info(f'load model, model arch: {cfg...
I thought was the whole point of the example code in the docs: config = BertConfig.from_pretrained('bert-base-uncased') tokenizer = BertTokenizer.from_pretrained('bert-base-uncased') model = BertForMaskedLM(config) input_ids = torch.tensor(tokenizer.encode("Hello, my dog is cute")).unsq...