-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
41 lines (30 loc) · 1.06 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
import argparse
def parse_args() -> argparse.Namespace:
"""
Parser command argument for finetuning BERT such as
returns argparse.Namespace
"""
parser = argparse.ArgumentParser("Finetune QA on Domain Powerset")
parser.add_argument("--lr", type=float, default=2e-5, help="learning rate")
parser.add_argument("--batch_size", type=int, default=16, help="batch size")
parser.add_argument("--epochs", type=int, default=3, help="number of epochs")
parser.add_argument(
"--bert_name", type=str, default="bert-base-uncased", help="name of bert model"
)
parser.add_argument(
"--domains",
type=str,
nargs="+",
default=["w", "v", "n"],
help="domains to include",
)
args = parser.parse_args()
return args
def main(args: argparse.Namespace) -> None:
"""Finetunes BERT on Domain Powerset
Args:
args (argparse.Namespace): the arguments parsed from CLI
"""
# TODO: set up training and call training pipeline
if __name__ == "__main__":
args = parse_args()