-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
55 lines (47 loc) · 2.05 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
from src import logger
from src.pipeline.stage_01_data_ingestion import DataIngestionTrainingPipeline
from src.pipeline.stage_02_prepare_base_model import PrepareBaseModelTrainingPipeline
from src.pipeline.stage_03_training import ModelTrainingPipeline
from src.pipeline.stage_04_evaluation import ModelEvaluationPipeline
STAGE_NAME = "Data Ingestion stage"
if __name__ == '__main__':
try:
logger.info(f" Stage {STAGE_NAME} started ≤≤≤≤≤≤≤≤≤≤≤")
obj = DataIngestionTrainingPipeline()
obj.main()
logger.info(f">>>>>> Stage {STAGE_NAME} completed >>>>>>>>>>>>>>>")
except Exception as e:
logger.exception(f" Stage {STAGE_NAME} failed >>>>>>>>>>>")
raise e
STAGE_NAME = "Prepare base model"
if __name__ == '__main__':
try:
logger.info(f" Stage {STAGE_NAME} started")
obj = PrepareBaseModelTrainingPipeline()
obj.main()
logger.info(f" Stage {STAGE_NAME} completed")
except Exception as e:
logger.exception(f" Stage {STAGE_NAME} failed as {e}")
raise e
STAGE_NAME = "Training stage"
if __name__ == '__main__':
try:
logger.info(f" ••••••••••••••••••••••• ")
logger.info(f">>>>>> stage {STAGE_NAME} started >>>>>>>>>>>>>>>")
obj = ModelTrainingPipeline()
obj.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed >>>>>>>>>>>>>>>")
except Exception as e:
logger.exception(f" stage {STAGE_NAME} failed and Error {e}>>>>>>>>>>>")
raise e
STAGE_NAME = "Evaluation stage"
if __name__ == '__main__':
try:
logger.info(f" ••••••••••••••••••••••• ")
logger.info(f">>>>>> stage {STAGE_NAME} started >>>>>>>>>>>>>>>")
obj = ModelEvaluationPipeline()
obj.main()
logger.info(f">>>>>> stage {STAGE_NAME} completed >>>>>>>>>>>>>>>")
except Exception as e:
logger.exception(f" stage {STAGE_NAME} failed and Error {e}>>>>>>>>>>>")
raise e