(args)
| 99 | |
| 100 | |
| 101 | def test(args): |
| 102 | print("Evaluation on testset:") |
| 103 | model_path = args.model_dir + 'bert' + args.task + '.pt' |
| 104 | model = torch.load(model_path).to(args.device) |
| 105 | model.eval() |
| 106 | |
| 107 | sentence_packs = json.load(open(args.prefix + args.dataset + '/test.json')) |
| 108 | instances = load_data_instances(sentence_packs, args) |
| 109 | testset = DataIterator(instances, args) |
| 110 | eval(model, testset, args) |
| 111 | |
| 112 | |
| 113 | if __name__ == '__main__': |
no test coverage detected