Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

main.py 2.1 KB

You have to be logged in to leave a comment. Sign In
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
56
57
58
59
60
61
62
63
64
  1. from mlProject import logger
  2. from mlProject.pipeline.stage_01_data_ingestion import DataIngestionTrainingPipeline
  3. from mlProject.pipeline.stage_02_data_validation import DataValidationTrainingPipeline
  4. from mlProject.pipeline.stage_03_data_transformation import DataTransformationTrainingPipeline
  5. STAGE_NAME = "Data Ingestion stage"
  6. try:
  7. # Log start of the data ingestion stage
  8. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  9. # Instantiate the DataIngestionTrainingPipeline object
  10. pipeline = DataIngestionTrainingPipeline()
  11. # Execute the main method to run the data ingestion pipeline
  12. pipeline.main()
  13. # Log completion of the data ingestion stage
  14. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  15. except Exception as e:
  16. # Log any exceptions that occur during the pipeline execution
  17. logger.exception(e)
  18. raise e # Re-raise the exception for further handling
  19. STAGE_NAME = "Data Validation Stage"
  20. try:
  21. # Log start of the data validation stage
  22. logger.info(f">>>>>> stage {STAGE_NAME} started <<<<<<")
  23. # Instantiate the DataValidationTrainingPipeline object
  24. pipeline = DataValidationTrainingPipeline()
  25. # Execute the main method to run the data validation pipeline
  26. pipeline.main()
  27. # Log completion of the data validation stage
  28. logger.info(f">>>>>> stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  29. except Exception as e:
  30. # Log any exceptions that occur during the pipeline execution
  31. logger.exception(e)
  32. raise e # Re-raise the exception for further handling
  33. STAGE_NAME = "Data Transformation Stage"
  34. try:
  35. # Log start of the stage
  36. logger.info(f">>>>>> Stage {STAGE_NAME} started <<<<<<")
  37. # Initialize DataTransformationTrainingPipeline object
  38. obj = DataTransformationTrainingPipeline()
  39. # Execute main method of the pipeline
  40. obj.main()
  41. # Log completion of the stage
  42. logger.info(f">>>>>> Stage {STAGE_NAME} completed <<<<<<\n\nx==========x")
  43. except Exception as e:
  44. # Log any exceptions that occur during the stage
  45. logger.exception(e)
  46. # Re-raise the exception for further handling
  47. raise e
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...