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 1.4 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
  1. import logging
  2. from potholeClassifier.pipeline.stage_01_data_ingestion import DataIngestionPipeline
  3. from potholeClassifier.pipeline.stage_02_prepare_base_model import PrepareBaseModelPipeline
  4. from potholeClassifier.pipeline.stage_03_model_training import TrainingPipeline
  5. from potholeClassifier.pipeline.stage_04_model_evaluation import EvaluationPipeline
  6. logger = logging.getLogger('potholeClassifierLogger')
  7. def execute_pipeline_stage(stage_name: str, pipeline_obj: object) -> None:
  8. """
  9. Execute a specific pipeline stage.
  10. Args:
  11. stage_name (str): The name of the pipeline stage.
  12. pipeline_obj: The pipeline object to execute.
  13. Returns:
  14. None
  15. """
  16. try:
  17. logger.info(f">>>>>> {stage_name} STARTED <<<<<<")
  18. pipeline_obj.main()
  19. logger.info(
  20. f">>>>>> {stage_name} COMPLETED <<<<<<<\n\n\n")
  21. except Exception as e:
  22. logger.exception(e)
  23. raise e
  24. if __name__ == "__main__":
  25. STAGE_NAME = "DATA INGESTION"
  26. data_ingestion = DataIngestionPipeline()
  27. execute_pipeline_stage(STAGE_NAME, data_ingestion)
  28. STAGE_NAME = "PREPARING BASE MODEL"
  29. obj = PrepareBaseModelPipeline()
  30. execute_pipeline_stage(STAGE_NAME, obj)
  31. STAGE_NAME = "MODEL TRAINING"
  32. obj = TrainingPipeline()
  33. execute_pipeline_stage(STAGE_NAME, obj)
  34. STAGE_NAME = "MODEL EVALUATION"
  35. obj = EvaluationPipeline()
  36. execute_pipeline_stage(STAGE_NAME, obj)
Tip!

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

Comments

Loading...