-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
39 lines (31 loc) · 1014 Bytes
/
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
'''
This module contains the main function for the training pipeline.
author: Saurabh Bhardwaj
date: October 2023
'''
# import necessary libraries
from src.logger import logging
from src.pipeline.training_pipeline import TrainPipeline
from src.logger import logging
from src.pipeline.training_pipeline import TrainPipeline
def main():
"""
The main function to execute the training pipeline for a machine learning model.
This function creates a training pipeline instance and runs it to train a model. It handles exceptions
and logs any errors.
Raises:
Exception: If any errors occur during the pipeline execution.
Returns:
None
"""
try:
# Create a training pipeline instance
training_pipeline = TrainPipeline()
# Run the training pipeline
training_pipeline.run_pipeline()
except Exception as e:
# Handle exceptions and log errors
print(e)
logging.exception(e)
if __name__ == "__main__":
main()