Spaces:
Sleeping
Sleeping
Download python_backend/src/CodeRunAndModelTrain/pipelines/JobFetcherPipeline.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 1.22 kB
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/CodeRunAndModelTrain/pipelines/JobFetcherPipeline.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/src/CodeRunAndModelTrain/pipelines/JobFetcherPipeline.py
-
curl -L -o JobFetcherPipeline.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/src/CodeRunAndModelTrain/pipelines/JobFetcherPipeline.py
1.22 kB
| from src.CodeRunAndModelTrain.components.job_fetcher import JobFetcher | |
| from src.CodeRunAndModelTrain.utils.Abstract import Pipeline | |
| from src.CodeRunAndModelTrain.entity.config_entity import JobFetcherConfig | |
| from utils.asyncHandler import asyncHandler | |
| import os | |
| import logging | |
| class JobFetcherPipeline(Pipeline): | |
| def __init__(self): | |
| super().__init__() | |
| self.job_fetcher_config = JobFetcherConfig() | |
| self.job_fetcher = JobFetcher(job_fetcher_config=self.job_fetcher_config) | |
| async def initiate(self, jobtile: str="Machine Learning",updated:bool=False): | |
| print("received",jobtile,updated) | |
| if not updated and os.path.exists(os.path.join("artifact","jobs",jobtile+".csv")): | |
| logging.info("loading jobs from the saved file") | |
| self.job_fetcher_config.saved_jobs_file_path=os.path.join("artifact","jobs",jobtile+".csv") | |
| return self.job_fetcher_config | |
| logging.info("Entered in the initiate JobFetcherPipeline method") | |
| result = await self.job_fetcher.fetch(jobtile=jobtile) | |
| logging.info("jobFetcher execution completed") | |
| logging.info("Exiting from JobFetcherPipeline method") | |
| return result | |