-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
61 lines (32 loc) · 2.15 KB
/
main.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import classifier
import argparse
#hugging face api autonlp argugments (passed back to lower level in stack)
parser = argparse.ArgumentParser(description='Training Calssifier ')
parser.add_argument('--input csv', default='gender-classifier-DFE-791531.csv',
type=str, help='relative loacation of input csv for training')
parser.add_argument('--project', default='gender_class', type=str, help='poject name')
parser.add_argument('--split', default='train', type=str, help='dataset split')
parser.add_argument('--col_mapping',default=None, type=str, help='text:text, label:target')
parser.add_argument('--files',default='gender_text_train.csv', type=str,
help='formated csv only 2 colls one for text one for target')
parser.add_argument('--api_key', default=None, type=str, help='api key from hugging_face account')
parser.add_argument('--resize', type=int, help='Resizes images by percentage as scalar')
parser.add_argument('--name', type=str, help='project name hugging face')
parser.add_argument('--language', type=str, help='lang in eg [en,sp,fr]')
parser.add_argument('--task', type=str, default='binary_classification',
help='Resizes images by percentage as scalar')
parser.add_argument('--max_models', type=int, default=2, help= 'nuber of trainable models')
parser.add_argument('--create_project', action='store_true', help='create_new hf project')
#meta args-- directing sub process
parser.add_argument('--hugging_face', action='store_true', help='uses hugging face api to train model')
parser.add_argument('--send', action='store_true', help='if entered will try to sen .csv')
parser.add_argument('--login', action='store_true', help='if entered will try to sen .csv')
parser.add_argument('--make', action='store_true', help='create_new hf project')
parser.add_argument('--train', action='store_true', help='create_new hf project')
args = parser.parse_args()
if __name__=='__main__':
print('here')
if args.hugging_face:
print(args.api_key)
classifier.train_hf_api(args)
print('Model trianing using autonlp (hugging face api)')