|
a |
|
b/pipeline.py |
|
|
1 |
import argparse |
|
|
2 |
import json |
|
|
3 |
|
|
|
4 |
from pipelines import pipelines |
|
|
5 |
|
|
|
6 |
|
|
|
7 |
def parse_args(): |
|
|
8 |
parser = argparse.ArgumentParser() |
|
|
9 |
parser.add_argument("--config", required=True) |
|
|
10 |
return parser.parse_args() |
|
|
11 |
|
|
|
12 |
|
|
|
13 |
if __name__ == "__main__": |
|
|
14 |
args = parse_args() |
|
|
15 |
config = json.loads(open(args.config).read()) |
|
|
16 |
pipeline_type = getattr(pipelines, config["type"]) |
|
|
17 |
|
|
|
18 |
print("Trainer: ", config["type"], pipeline_type) |
|
|
19 |
pipeline = pipeline_type(config) |
|
|
20 |
pipeline.run_pipeline() |