-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_training.py
More file actions
28 lines (25 loc) · 894 Bytes
/
run_training.py
File metadata and controls
28 lines (25 loc) · 894 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
28
"""
Wrapper to run MSA training on a GPU server.
Adapts paths for whatever environment you're running on.
Usage:
python run_training.py # runs v2 by default
python run_training.py --v1 # runs v1
"""
import sys
import argparse
from pathlib import Path
parser = argparse.ArgumentParser()
parser.add_argument('--v1', action='store_true', help='Run v1 training instead of v2')
args = parser.parse_args()
if args.v1:
import importlib.util
spec = importlib.util.spec_from_file_location("train_v1", Path(__file__).parent / "05_train_v1.py")
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
mod.main()
else:
import importlib.util
spec = importlib.util.spec_from_file_location("train_v2", Path(__file__).parent / "06_train_v2.py")
mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(mod)
mod.main()