Spaces:
Sleeping
Sleeping
Download python_backend/api/CodeRunAndModelTrain/routes/jobFetcher_router.py from VashuTheGreat2/ML-Learner: direct link, hf CLI and curl.
- Browser
- Download file 680 Bytes
-
https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/api/CodeRunAndModelTrain/routes/jobFetcher_router.py
- Command line
-
hf download hf://spaces/VashuTheGreat2/ML-Learner/python_backend/api/CodeRunAndModelTrain/routes/jobFetcher_router.py
-
curl -L -o jobFetcher_router.py https://huggingface.co/spaces/VashuTheGreat2/ML-Learner/resolve/main/python_backend/api/CodeRunAndModelTrain/routes/jobFetcher_router.py
680 Bytes
| import fastapi | |
| from src.CodeRunAndModelTrain.pipelines.JobFetcherPipeline import JobFetcherPipeline | |
| from exception import MyException | |
| import pandas as pd | |
| import sys | |
| router=fastapi.APIRouter() | |
| async def jobFetcher(jobtile: str="machine learning intern",updated:bool=False): | |
| try: | |
| job_fetcher_pipeline=JobFetcherPipeline() | |
| jobtile=jobtile.lower() | |
| res=await job_fetcher_pipeline.initiate(jobtile=jobtile,updated=updated) | |
| data=pd.read_csv(res.saved_jobs_file_path) | |
| data = data.where(pd.notnull(data), None) | |
| return data.to_dict(orient="records") | |
| except Exception as e: | |
| raise MyException(e, sys) |