PreSumm
PreSumm copied to clipboard
Using Model for Inference
Hi ! I am also trying to use the model for inference but when I use the above mode with a singular checkpoint. Using this command python train.py -task ext -mode train -bert_data_path ../bert_data/cnndm -ext_dropout 0.1 -model_path ../models -lr 2e-3 -visible_gpus 0 -report_every 50 -save_checkpoint_steps 1000 -batch_size 3000 -train_steps 50000 -accum_count 2 -log_file ../logs/ext_bert_cnndm -use_interval true -warmup_steps 10000 -max_pos 512
I get this error during train,validate or test: File "D:\code\PreSumm-master\PreSumm-master\src\models\data_loader.py", line 195, in preprocess tgt = ex['tgt'][:self.args.max_tgt_len][:-1]+[2] KeyError: 'tgt'
As far as I know, for interference you need to use -mode test and use -test_from path/to/pt.file
Had the same error when I used the data downloaded from the BertSum README (https://github.com/nlpyang/BertSum). Changed it with the one from PreSumm (https://github.com/nlpyang/PreSumm) and I no longer have the error. Hope it helps!