-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.py
More file actions
27 lines (22 loc) · 764 Bytes
/
main.py
File metadata and controls
27 lines (22 loc) · 764 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import yaml
import argparse
import os
import numpy as np
from data.parser import Parser
from data.processor import LogDataProcessor
from data.dataset import ElectraDataset
from utils import seed_all
from train_test.trainer import ElectraTrainer
from train_test.tester import ElectraTester
seed_all(42)
parser = argparse.ArgumentParser()
parser.add_argument('--config', type=str, default='bgl.yaml', help='config file name.')
args = parser.parse_args()
configs = yaml.load(open(os.path.join('./configs', args.config), 'r'), Loader=yaml.FullLoader)
model_configs = configs['model_configs']
del configs['model_configs']
trainer = ElectraTrainer(model_configs, configs)
trainer.train()
# # del trainer
tester = ElectraTester(model_configs, configs)
tester.test()