forked from izam-mohammed/GemInsights
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
42 lines (36 loc) · 1.29 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
from gemInsights import logger
from gemInsights.pipeline.stage_00_data_ingestion import (
DataIngestionPredictionPipeline
)
from gemInsights.pipeline.stage_01_data_visualization import (
DataVisualizationPredictionPipeline,
)
from gemInsights.pipeline.stage_02_prompt_generation import (
PromptGenerationPredictionPipeline,
)
from gemInsights.pipeline.stage_03_prompting import (
PromptingPredictionPipeline
)
def run_pipeline(stage_name, pipeline_instance):
"""
Run a specific stage of the sentiment analysis pipeline.
Parameters:
- stage_name: str
Name of the pipeline stage.
- pipeline_instance: object
Instance of the pipeline stage to be executed.
Returns:
None
"""
try:
logger.info(f">>>>>> Stage {stage_name} started <<<<<<")
pipeline_instance.main()
logger.info(f">>>>>> Stage {stage_name} completed <<<<<<\n\nx==========x")
except Exception as e:
logger.exception(e)
raise e
if __name__ == "__main__":
run_pipeline("Data Ingestion", DataIngestionPredictionPipeline())
run_pipeline("Data visualization", DataVisualizationPredictionPipeline())
run_pipeline("Data Prompt Generation", PromptGenerationPredictionPipeline())
run_pipeline("Prompting", PromptingPredictionPipeline())