-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrain.py
38 lines (24 loc) · 968 Bytes
/
train.py
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
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
# coding: utf-8
# @Author : Xinhao Mei @CVSSP, University of Surrey
# @E-mail : [email protected]
import os
import argparse
import torch
# from trainer.trainer_OT import train
# from trainer.trainer_minibatch_noisy import train
from trainer.trainer_minibatch_Maha import train
from tools.config_loader import get_config
if __name__ == '__main__':
os.environ['CUDA_LAUNCH_BLOCKING'] = '1'
os.environ['TOKENIZERS_PARALLELISM'] = 'false'
torch.backends.cudnn.enabled = False
parser = argparse.ArgumentParser(description='Settings.')
parser.add_argument('-n', '--exp_name', default='exp_name', type=str,
help='Name of the experiment.')
parser.add_argument('-c', '--config', default='settings', type=str,
help='Name of the setting file.')
args = parser.parse_args()
config = get_config(args.config)
config.exp_name = args.exp_name
train(config)