MCPcopy Create free account
hub / github.com/NJUNLP/GTS / test

Function test

code/BertModel/main.py:101–110  ·  view source on GitHub ↗
(args)

Source from the content-addressed store, hash-verified

99
100
101def 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
113if __name__ == '__main__':

Callers 1

main.pyFile · 0.70

Calls 3

load_data_instancesFunction · 0.90
DataIteratorClass · 0.90
evalFunction · 0.70

Tested by

no test coverage detected